Prevent geospatial plugin exception when geomap contains empty geolayer widget (#8484)

* Prevent exception when geomap contains empty geolayer widget

* Convert testcase widget into testcase tiddler
This commit is contained in:
btheado
2024-08-30 09:21:46 -04:00
committed by GitHub
parent 5094096a87
commit 9a4aafdb41
2 changed files with 25 additions and 4 deletions

View File

@@ -262,10 +262,12 @@ GeomapWidget.prototype.refreshMap = function() {
var bounds = null;
$tw.utils.each(this.renderedLayers,function(layer) {
var featureBounds = layer.layer.getBounds();
if(bounds) {
bounds.extend(featureBounds);
} else {
bounds = featureBounds;
if(featureBounds.isValid()) {
if(bounds) {
bounds.extend(featureBounds);
} else {
bounds = featureBounds;
}
}
});
if(bounds) {