[view/map,bugfix] Reapply fix from 5eb65f, lost due to a bad merge

This commit is contained in:
amercader 2012-04-25 12:24:43 +01:00
parent d589596533
commit 0b6840819e

View File

@ -127,10 +127,12 @@ my.Map = Backbone.View.extend({
this.bind('view:show',function(){
// If the div was hidden, Leaflet needs to recalculate some sizes
// to display properly
self.map.invalidateSize();
if (self._zoomPending && self.autoZoom) {
self._zoomToFeatures();
self._zoomPending = false;
if (self.map){
self.map.invalidateSize();
if (self._zoomPending && self.autoZoom) {
self._zoomToFeatures();
self._zoomPending = false;
}
}
self.visible = true;
});