google triggers map changed but does not return bounds if map was never visible
This commit is contained in:
parent
48b2c1f2ba
commit
0396aa0679
1 changed files with 6 additions and 2 deletions
|
@ -922,8 +922,12 @@ Ox.Map = function(options, self) {
|
||||||
// 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.
|
||||||
if (self.boundsChanged) {
|
if (self.boundsChanged) {
|
||||||
var bounds = self.map.getBounds(),
|
var bounds = self.map.getBounds()
|
||||||
southWest = bounds.getSouthWest(),
|
if (!bounds) {
|
||||||
|
self.boundsChanged = false;
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var southWest = bounds.getSouthWest(),
|
||||||
northEast = bounds.getNorthEast(),
|
northEast = bounds.getNorthEast(),
|
||||||
south = southWest.lat(),
|
south = southWest.lat(),
|
||||||
west = southWest.lng(),
|
west = southWest.lng(),
|
||||||
|
|
Loading…
Reference in a new issue