Merge pull request #3594 from Leaflet/cors-image-overlay
Allow for access to imageData on L.ImageOverlay
This commit is contained in:
commit
c7ecc97d57
@ -8,6 +8,10 @@ L.ImageOverlay = L.Layer.extend({
|
||||
opacity: 1,
|
||||
alt: '',
|
||||
interactive: false
|
||||
|
||||
/*
|
||||
crossOrigin: <Boolean>,
|
||||
*/
|
||||
},
|
||||
|
||||
initialize: function (url, bounds, options) { // (String, LatLngBounds, Object)
|
||||
@ -114,6 +118,11 @@ L.ImageOverlay = L.Layer.extend({
|
||||
img.onmousemove = L.Util.falseFn;
|
||||
|
||||
img.onload = L.bind(this.fire, this, 'load');
|
||||
|
||||
if (this.options.crossOrigin) {
|
||||
img.crossOrigin = '';
|
||||
}
|
||||
|
||||
img.src = this._url;
|
||||
img.alt = this.options.alt;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user