mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-10-19 17:22:12 +00:00
split routing controls in zoom-specific layers to improve performance
This commit is contained in:
1 parent
88abd72a41
commit
d6c9fb1025
3 files changed
+111
-66
No files matched your search
@@ -5,7 +5,13 @@
|
||||
|
||||
map.onLoad((map_) => {
|
||||
map_.on('contextmenu', (e) => {
|
||||
if (map_.queryRenderedFeatures(e.point, { layers: ['routing-controls'] }).length) {
|
||||
if (
|
||||
map_.queryRenderedFeatures(e.point, {
|
||||
layers: map_
|
||||
.getLayersOrder()
|
||||
.filter((layerId) => layerId.startsWith('routing-controls')),
|
||||
}).length
|
||||
) {
|
||||
// Clicked on routing control, ignoring
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user