MCPcopy Create free account
hub / github.com/angular/examples / updateTileLayer

Method updateTileLayer

logistics-manager-app/src/app/components/map/map.ts:58–71  ·  view source on GitHub ↗
(isDark: boolean)

Source from the content-addressed store, hash-verified

56 }
57
58 private updateTileLayer(isDark: boolean) {
59 if (!this.map || !this.L) return;
60 const L = this.L;
61
62 const url = isDark
63 ? 'https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png'
64 : 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png';
65
66 if (this.tileLayer) {
67 this.tileLayer.setUrl(url);
68 } else {
69 this.tileLayer = L.tileLayer(url, { maxZoom: 20 }).addTo(this.map);
70 }
71 }
72
73 private updateMarkers(activeUnitId: string | null = null) {
74 if (!this.map || !this.L) return;

Callers 2

constructorMethod · 0.95
initMapMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected