wait for google maps to be loaded
This commit is contained in:
parent
95e6e4c36f
commit
7bb3d5d185
1 changed files with 21 additions and 9 deletions
|
@ -714,6 +714,11 @@ Ox.Map = function(options, self) {
|
|||
}
|
||||
|
||||
function getMapBounds(callback) {
|
||||
if (!self.loaded) {
|
||||
setTimeout(function() {
|
||||
getMapBounds(callback);
|
||||
}, 100);
|
||||
} else {
|
||||
// get initial map bounds
|
||||
self.options.places({}, function(result) {
|
||||
var area = result.data.area;
|
||||
|
@ -723,6 +728,7 @@ Ox.Map = function(options, self) {
|
|||
));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getMapHeight() {
|
||||
return self.options.height
|
||||
|
@ -1426,8 +1432,14 @@ Ox.Map = function(options, self) {
|
|||
}
|
||||
|
||||
function zoom(z) {
|
||||
if (!self.loaded) {
|
||||
setTimeout(function() {
|
||||
zoom(z);
|
||||
}, 100);
|
||||
} else {
|
||||
self.map.setZoom(self.map.getZoom() + z);
|
||||
}
|
||||
}
|
||||
|
||||
function zoomChanged() {
|
||||
var zoom = self.map.getZoom();
|
||||
|
|
Loading…
Reference in a new issue