fix a map positioning bug

This commit is contained in:
rolux 2012-06-19 17:42:53 +02:00
parent 4c3ef380b1
commit 0d802a16c9

View file

@ -509,7 +509,8 @@ Ox.Map = function(options, self) {
});
if (window.google) {
initMap();
// timeout needed so that the map is in the DOM
setTimeout(initMap);
} else if (window.googleCallback) {
(function interval() {
window.google ? initMap() : setTimeout(interval, 100);
@ -874,14 +875,7 @@ 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 seems to sometimes set position to 'relative'
if (self.$map.css('position') == 'absolute') {
google.maps.event.trigger(self.map, 'resize');
} else {
self.$map.css({position: 'absolute'});
that.resizeMap();
}
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