From 8a50077f0f0507bfdb84fd3a3109c8bab8390f13 Mon Sep 17 00:00:00 2001 From: Kanahiro Date: Sun, 25 Aug 2024 14:46:33 +0900 Subject: [PATCH] popup timing --- src/viewer.html | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/viewer.html b/src/viewer.html index 72e1002..6fc1df5 100644 --- a/src/viewer.html +++ b/src/viewer.html @@ -106,17 +106,19 @@ map.addControl(new ViewstateControl()); map.addControl(new maplibregl.NavigationControl()); - map.addControl( + const inspect = new MaplibreInspect({ // loaded from CDN - new MaplibreInspect({ - popup: new maplibregl.Popup({ - closeButton: false, - closeOnClick: false, - }), + popup: new maplibregl.Popup({ + closeButton: false, + closeOnClick: false, }), - ); + }); + map.addControl(inspect); map.on('click', (e) => { + if (inspect.showInspectMap) { + return; + } // detect layers const features = map.queryRenderedFeatures(e.point); const layerIds = features.map((f) => f.layer.id);