[view/map][s] Recalculate Leaflet sizes when showing the container div

This commit is contained in:
amercader 2012-04-10 17:14:22 +01:00
parent 5891149087
commit 23c6a6e81b

View File

@ -42,6 +42,12 @@ my.Map = Backbone.View.extend({
this.model.currentDocuments.bind('remove', function(doc){self.redraw('remove',doc)});
this.model.currentDocuments.bind('reset', function(){self.redraw('reset')});
// If the div is hidden, Leaflet needs to recalculate some sizes
// to display properly
this.bind('view:show',function(){
self.map.invalidateSize();
});
this.mapReady = false;
this.render();