wait for google maps to be loaded

This commit is contained in:
j 2014-04-11 19:45:49 +00:00
parent 95e6e4c36f
commit 7bb3d5d185

View file

@ -714,6 +714,11 @@ Ox.Map = function(options, self) {
} }
function getMapBounds(callback) { function getMapBounds(callback) {
if (!self.loaded) {
setTimeout(function() {
getMapBounds(callback);
}, 100);
} else {
// get initial map bounds // get initial map bounds
self.options.places({}, function(result) { self.options.places({}, function(result) {
var area = result.data.area; var area = result.data.area;
@ -723,6 +728,7 @@ Ox.Map = function(options, self) {
)); ));
}); });
} }
}
function getMapHeight() { function getMapHeight() {
return self.options.height return self.options.height
@ -1426,8 +1432,14 @@ Ox.Map = function(options, self) {
} }
function zoom(z) { function zoom(z) {
if (!self.loaded) {
setTimeout(function() {
zoom(z);
}, 100);
} else {
self.map.setZoom(self.map.getZoom() + z); self.map.setZoom(self.map.getZoom() + z);
} }
}
function zoomChanged() { function zoomChanged() {
var zoom = self.map.getZoom(); var zoom = self.map.getZoom();