diff options
author | Daniel Schadt <kingdread@gmx.de> | 2022-11-21 23:04:49 +0100 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2022-11-21 23:04:49 +0100 |
commit | 5e3a9af1ddea90be2478ea69dae687c948532db1 (patch) | |
tree | 3740e6adbcb3a77bfebf06cf3286cee40746a9c8 | |
parent | 7adc3c0c9cb1f866b61a4d21be9a7d7d0e01df11 (diff) | |
download | fietsboek-5e3a9af1ddea90be2478ea69dae687c948532db1.tar.gz fietsboek-5e3a9af1ddea90be2478ea69dae687c948532db1.tar.bz2 fietsboek-5e3a9af1ddea90be2478ea69dae687c948532db1.zip |
fix map if OSM layer is not present
-rw-r--r-- | fietsboek/static/osm-monkeypatch.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fietsboek/static/osm-monkeypatch.js b/fietsboek/static/osm-monkeypatch.js index a8310a2..586901a 100644 --- a/fietsboek/static/osm-monkeypatch.js +++ b/fietsboek/static/osm-monkeypatch.js @@ -15,6 +15,13 @@ dieses.mapcanvas = mapcanvas; this.cluster_zoomhistory = []; + // The change function is doing weird things and expects the OSM layer + // to be there, which leads to exceptions and the map not working at + // all if the OSM layer is disabled. We fix this by simply not caring + // about the change function. + // See https://gitlab.com/dunj3/fietsboek/-/issues/27 + this.change = (_) => {}; + // Map anlegen const mycp = '<a href="https://www.j-berkemeier.de/GPXViewer" title="GPX Viewer '+JB.GPX2GM.ver+'">GPXViewer</a> | '; @@ -76,6 +83,8 @@ keyboard: genugplatz, touchZoom: true, dragging: true, + // Make sure we get the first layer in there + layers: Object.values(this.baseLayers)[0], } ); JB.handle_touch_action(dieses,genugplatz); |