From 0396aa0679b54c0e5a5361a2656b0e44aee8bd6f Mon Sep 17 00:00:00 2001 From: j Date: Thu, 27 Apr 2023 10:54:12 +0200 Subject: [PATCH] google triggers map changed but does not return bounds if map was never visible --- source/UI/js/Map/Map.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/UI/js/Map/Map.js b/source/UI/js/Map/Map.js index 70a54676..9f5c4392 100644 --- a/source/UI/js/Map/Map.js +++ b/source/UI/js/Map/Map.js @@ -922,8 +922,12 @@ Ox.Map = function(options, self) { // This is the handler that actually adds the places to the map. // Gets called after panning or zooming, and when the map is idle. if (self.boundsChanged) { - var bounds = self.map.getBounds(), - southWest = bounds.getSouthWest(), + var bounds = self.map.getBounds() + if (!bounds) { + self.boundsChanged = false; + return + } + var southWest = bounds.getSouthWest(), northEast = bounds.getNorthEast(), south = southWest.lat(), west = southWest.lng(),