Change animateMarkerZoom to use a class/style rather than setting visibility directly.

This commit is contained in:
danzel 2012-06-21 11:22:22 +12:00
parent 106228647e
commit 6d725f02cd
2 changed files with 6 additions and 8 deletions

4
dist/leaflet.css vendored
View File

@ -290,6 +290,10 @@ a.leaflet-active {
transition: none;
}
.leaflet-zoom-anim .leaflet-zoom-hide {
visibility: hidden;
}
/* Popup layout */
.leaflet-popup {

View File

@ -36,14 +36,8 @@ L.Map = L.Class.extend({
}
if (!options.animateMarkerZoom) {
this.on('zoomstart', function () {
this._panes.markerPane.style.visibility = 'hidden';
this._panes.shadowPane.style.visibility = 'hidden';
});
this.on('zoomend', function () {
this._panes.markerPane.style.visibility = 'visible';
this._panes.shadowPane.style.visibility = 'visible';
});
this._panes.markerPane.className += ' leaflet-zoom-hide';
this._panes.shadowPane.className += ' leaflet-zoom-hide';
}
this._initLayers(options.layers);