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) {
|
if (window.google) {
|
||||||
initMap();
|
// timeout needed so that the map is in the DOM
|
||||||
|
setTimeout(initMap);
|
||||||
} else if (window.googleCallback) {
|
} else if (window.googleCallback) {
|
||||||
(function interval() {
|
(function interval() {
|
||||||
window.google ? initMap() : setTimeout(interval, 100);
|
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, 'idle', mapChanged);
|
||||||
google.maps.event.addListener(self.map, 'zoom_changed', zoomChanged);
|
google.maps.event.addListener(self.map, 'zoom_changed', zoomChanged);
|
||||||
google.maps.event.addListenerOnce(self.map, 'tilesloaded', tilesLoaded);
|
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') {
|
|
||||||
google.maps.event.trigger(self.map, 'resize');
|
|
||||||
} else {
|
|
||||||
self.$map.css({position: 'absolute'});
|
|
||||||
that.resizeMap();
|
|
||||||
}
|
|
||||||
|
|
||||||
// needed to get mouse x/y coordinates on marker mouseover,
|
// needed to get mouse x/y coordinates on marker mouseover,
|
||||||
// see http://code.google.com/p/gmaps-api-issues/issues/detail?id=2342
|
// see http://code.google.com/p/gmaps-api-issues/issues/detail?id=2342
|
||||||
|
|
Loading…
Add table
Reference in a new issue