Skip to content

Commit

Permalink
feat(gis): add query param to remove navigation control
Browse files Browse the repository at this point in the history
  • Loading branch information
Joxit committed Sep 13, 2023
1 parent d8ad60b commit 6fed7d6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion examples/gis/category-filter.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@
style: `https://api.jawg.io/gis/maps/${mapId}/versions/latest/style?access-token=${accessToken}`,
zoom: 12,
center: [2.35071554, 48.85826376],
}).addControl(new maplibregl.NavigationControl(), "top-right");
});
const useNavigationControl = new URLSearchParams(window.location.search).get("navigation-control");
if (useNavigationControl !== "false") {
map.addControl(new maplibregl.NavigationControl(), "top-right");
}
// This plugin is used for right to left languages
maplibregl.setRTLTextPlugin("https://unpkg.com/@mapbox/[email protected]/mapbox-gl-rtl-text.min.js");

Expand Down
6 changes: 5 additions & 1 deletion examples/gis/cluster-air-quality.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@
style: `https://api.jawg.io/gis/maps/${mapId}/versions/latest/style?access-token=${accessToken}`,
zoom: 2,
center: [8.8, 10.9],
}).addControl(new maplibregl.NavigationControl(), "top-right");
});
const useNavigationControl = new URLSearchParams(window.location.search).get("navigation-control");
if (useNavigationControl !== "false") {
map.addControl(new maplibregl.NavigationControl(), "top-right");
}
// This plugin is used for right to left languages
maplibregl.setRTLTextPlugin("https://unpkg.com/@mapbox/[email protected]/mapbox-gl-rtl-text.min.js");

Expand Down
6 changes: 5 additions & 1 deletion examples/gis/polygon-styling.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@
style: `https://api.jawg.io/gis/maps/${mapId}/versions/latest/style?access-token=${accessToken}`,
zoom: 5,
center: [2.35, 47],
}).addControl(new maplibregl.NavigationControl(), "top-right");
});
const useNavigationControl = new URLSearchParams(window.location.search).get("navigation-control");
if (useNavigationControl !== "false") {
map.addControl(new maplibregl.NavigationControl(), "top-right");
}
// This plugin is used for right to left languages
maplibregl.setRTLTextPlugin("https://unpkg.com/@mapbox/[email protected]/mapbox-gl-rtl-text.min.js");

Expand Down

0 comments on commit 6fed7d6

Please sign in to comment.