diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2024-01-22 03:29:43 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2024-01-22 03:31:35 +0100 |
commit | eb468bb98ce4b8e91b8e14ec3643f1fdbe662977 (patch) | |
tree | 4b66046c32e0140ea34fe8990bdd965239c414e2 | |
parent | 0548452b7c2dfe57ade979483b9046d1e1e17f43 (diff) |
map.forEachFeatureAtPixel(): Add a layerFilter.
-rw-r--r-- | main.js | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -577,7 +577,8 @@ const styles = Object.keys(layers).reduce(function(result, key) { result[key] = layers[key].style; return result; }, {}); -map.addLayer(new VectorTileLayer({ + +const vectorLayer = new VectorTileLayer({ source: vectorSource, /* XXX switch to 'hybrid' if there are perf issues; but that seems to * put lines above points regardless of their respective z-index */ @@ -596,7 +597,8 @@ map.addLayer(new VectorTileLayer({ return style[i]; } }, -})); +}); +map.addLayer(vectorLayer); /* layer selection panel */ (function() { @@ -1032,6 +1034,7 @@ map.addLayer(new VectorTileLayer({ }, { hitTolerance: 5, checkWrapped: false, + layerFilter: (l) => l === vectorLayer, }); }); }()); |