From 4616f6a5bec78dba734e8fab06d226098bd6e12e Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Tue, 16 Aug 2011 08:08:18 +0800 Subject: [PATCH] Fix window resize exception - Leaflet expects 'map' at top level... --- web/js/map.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/js/map.js b/web/js/map.js index f977b137..48324ac3 100644 --- a/web/js/map.js +++ b/web/js/map.js @@ -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);