Added ImageOverlay load event, closed #213

This commit is contained in:
mourner 2011-12-14 13:38:42 +02:00
parent 8504147844
commit 5db85f2a76
2 changed files with 4 additions and 3 deletions

View File

@ -31,6 +31,7 @@ Leaflet Changelog
* Added ability to add a tile layer below all others (`map.addLayer(layer, true)`) (useful for switching base tile layers). * Added ability to add a tile layer below all others (`map.addLayer(layer, true)`) (useful for switching base tile layers).
* Added `hasLayer` method to `Map`. * Added `hasLayer` method to `Map`.
* Added `TileLayer` `continuousWorld` option to disable tile coordinates checking/wrapping. * Added `TileLayer` `continuousWorld` option to disable tile coordinates checking/wrapping.
* Added `ImageOverlay` `load` event. [#213](https://github.com/CloudMade/Leaflet/issues/213)
* Added `Polyline` `closestLayerPoint` method that's can be useful for interaction features (by [@anru](https://github.com/anru)). [#186](https://github.com/CloudMade/Leaflet/pull/186) * Added `Polyline` `closestLayerPoint` method that's can be useful for interaction features (by [@anru](https://github.com/anru)). [#186](https://github.com/CloudMade/Leaflet/pull/186)
* Added `setLatLngs` method to `MultiPolyline` and `MultiPolygon` (by [@anru](https://github.com/anru)). [#194](https://github.com/CloudMade/Leaflet/pull/194) * Added `setLatLngs` method to `MultiPolyline` and `MultiPolygon` (by [@anru](https://github.com/anru)). [#194](https://github.com/CloudMade/Leaflet/pull/194)
* Added `DomUtil.removeClass` method (by [@anru](https://github.com/anru)). * Added `DomUtil.removeClass` method (by [@anru](https://github.com/anru)).

View File

@ -35,7 +35,7 @@ L.ImageOverlay = L.Class.extend({
galleryimg: 'no', galleryimg: 'no',
onselectstart: L.Util.falseFn, onselectstart: L.Util.falseFn,
onmousemove: L.Util.falseFn, onmousemove: L.Util.falseFn,
onload: this._onImageLoad, onload: L.Util.bind(this._onImageLoad, this),
src: this._url src: this._url
}); });
}, },
@ -52,7 +52,7 @@ L.ImageOverlay = L.Class.extend({
}, },
_onImageLoad: function () { _onImageLoad: function () {
this.style.visibility = ''; this._image.style.visibility = '';
//TODO fire layerload this.fire('load');
} }
}); });