From 6a2da2064ce8628be44c8182ac93012d85fb5f6a Mon Sep 17 00:00:00 2001 From: Norbert Renner Date: Wed, 24 Mar 2021 09:22:11 +0100 Subject: [PATCH] Fix overpass layer not selected on hash init --- js/plugin/leaflet-fullHash.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/plugin/leaflet-fullHash.js b/js/plugin/leaflet-fullHash.js index 6254f62..de9a950 100644 --- a/js/plugin/leaflet-fullHash.js +++ b/js/plugin/leaflet-fullHash.js @@ -129,6 +129,11 @@ L.bind(function (obj, index, array) { if (obj) { layersControl.activateLayer(obj); + if (obj.layer instanceof OverpassLayer) { + // hack to select overlay (mark checked) in the layers control + // (OverpassLayer._layerAdd does not fire 'add' event) + layersControl._update(); + } if (obj && !obj.overlay) { added = true; }