google triggers map changed but does not return bounds if map was never visible

This commit is contained in:
j 2023-04-27 10:54:12 +02:00
parent 48b2c1f2ba
commit 0396aa0679

View file

@ -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(),