Fix window resize exception - Leaflet expects 'map' at top level...

This commit is contained in:
Mike Primm 2011-08-16 08:08:18 +08:00 committed by mikeprimm
parent 829e1339a8
commit 4616f6a5be

View File

@ -3,6 +3,7 @@
var componentconstructors = {};
var maptypes = {};
var map = null; // Leaflet assumes top-level 'map'...
componentconstructors['testcomponent'] = function(dynmap, configuration) {
console.log('initialize');
@ -126,6 +127,7 @@ DynMap.prototype = {
return (1 << zoom);
}
});
window.map = map; // Placate Leaflet need for top-level 'map'....
map.zoom_changed = function() {
me.maptype.updateTileSize(me.map.zoom);