fix a map positioning bug
This commit is contained in:
parent
4c3ef380b1
commit
0d802a16c9
1 changed files with 3 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue