wait until google.maps.LatLng is available
This commit is contained in:
parent
f302db9490
commit
470e6ac127
1 changed files with 5 additions and 1 deletions
|
@ -514,7 +514,7 @@ Ox.Map = function(options, self) {
|
||||||
setTimeout(initMap);
|
setTimeout(initMap);
|
||||||
} else if (window.googleCallback) {
|
} else if (window.googleCallback) {
|
||||||
(function interval() {
|
(function interval() {
|
||||||
window.google ? initMap() : setTimeout(interval, 100);
|
isLoaded() ? initMap() : setTimeout(interval, 100);
|
||||||
}());
|
}());
|
||||||
} else {
|
} else {
|
||||||
window.googleCallback = function() {
|
window.googleCallback = function() {
|
||||||
|
@ -951,6 +951,10 @@ Ox.Map = function(options, self) {
|
||||||
&& southWest.lng() == northEast.lng();
|
&& southWest.lng() == northEast.lng();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isLoaded() {
|
||||||
|
return window.google && window.google.maps && window.google.maps.LatLng;
|
||||||
|
}
|
||||||
|
|
||||||
function mapChanged() {
|
function mapChanged() {
|
||||||
// This is the handler that actually adds the places to the map.
|
// This is the handler that actually adds the places to the map.
|
||||||
// Gets called after panning or zooming, and when the map is idle.
|
// Gets called after panning or zooming, and when the map is idle.
|
||||||
|
|
Loading…
Reference in a new issue