MCPcopy Create free account
hub / github.com/Thanas-R/Virdis / hideExtraLabels

Function hideExtraLabels

src/components/MapView.tsx:31–39  ·  view source on GitHub ↗
(map: mapboxgl.Map)

Source from the content-addressed store, hash-verified

29 try { const s = localStorage.getItem(MAP_POS_KEY); if (s) return JSON.parse(s); } catch {}
30 return DEFAULT_INDIA_VIEW;
31}
32
33function hideExtraLabels(map: mapboxgl.Map) {
34 const style = map.getStyle();
35 if (!style?.layers) return;
36 style.layers.forEach((layer) => {
37 if (layer.id.includes("poi") || layer.id.includes("road-label") || layer.id.includes("transit") || layer.id.includes("building-") || (layer.id.includes("road") && layer.type === "symbol")) {
38 try { map.setLayoutProperty(layer.id, "visibility", "none"); } catch {}
39 }
40 });
41}
42

Callers 2

MapViewFunction · 0.85
handleStyleChangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected