Fix geospatial plugin map state loading (#8511)

This commit is contained in:
btheado
2024-09-30 14:49:33 +01:00
committed by GitHub
parent 0aa9cf6669
commit 7bf2fee15e
@@ -292,7 +292,7 @@ GeomapWidget.prototype.setMapView = function() {
this.map.setMaxZoom($tw.utils.parseInt(this.getAttribute("maxZoom"))); this.map.setMaxZoom($tw.utils.parseInt(this.getAttribute("maxZoom")));
} }
// Set the view to the content of the state tiddler // Set the view to the content of the state tiddler
var stateTiddler = this.geomapStateTitle && this.wiki.getTiddler(this.geomapStateTitle); var stateTiddler = this.getAttribute("state") && this.wiki.getTiddler(this.getAttribute("state"));
if(stateTiddler) { if(stateTiddler) {
this.map.setView([$tw.utils.parseNumber(stateTiddler.fields.lat,0),$tw.utils.parseNumber(stateTiddler.fields.long,0)], $tw.utils.parseNumber(stateTiddler.fields.zoom,0)); this.map.setView([$tw.utils.parseNumber(stateTiddler.fields.lat,0),$tw.utils.parseNumber(stateTiddler.fields.long,0)], $tw.utils.parseNumber(stateTiddler.fields.zoom,0));
return true; return true;