diff --git a/source/Ox.UI/js/Map/Map.js b/source/Ox.UI/js/Map/Map.js index c731984e..5e1cb00c 100644 --- a/source/Ox.UI/js/Map/Map.js +++ b/source/Ox.UI/js/Map/Map.js @@ -874,7 +874,14 @@ Ox.Map = function(options, self) { google.maps.event.addListener(self.map, 'idle', mapChanged); google.maps.event.addListener(self.map, 'zoom_changed', zoomChanged); google.maps.event.addListenerOnce(self.map, 'tilesloaded', tilesLoaded); - google.maps.event.trigger(self.map, 'resize'); + + // Google seems to sometimes set position to 'relative' + if (self.$map.css('position') == 'absolute') { + self.$map.css({position: 'absolute'}); + that.resizeMap(); + } else { + google.maps.event.trigger(self.map, 'resize'); + } // needed to get mouse x/y coordinates on marker mouseover, // see http://code.google.com/p/gmaps-api-issues/issues/detail?id=2342 @@ -918,14 +925,9 @@ Ox.Map = function(options, self) { } updateFormElements(); - //that.gainFocus(); self.loaded = true; that.triggerEvent('load'); - function tilesLoaded() { - setTimeout(formatTerms, 250); - } - }); } @@ -1335,6 +1337,10 @@ Ox.Map = function(options, self) { } } + function tilesLoaded() { + setTimeout(formatTerms, 250); + } + function toggleControls() { var $controls = that.find('.OxMapControl'); self.options.showControls = !self.options.showControls;