Closed niekvb closed 2 years ago
Traffic layer disappears when changing base map style, like this for example:
showSatellite(value: boolean): void { this._map.setStyle( value === true ? "mapbox://styles/mapbox/satellite-streets-v11" : "mapbox://styles/mapbox/streets-v11", ); }
The traffic layer's style, sources and layers are still loaded, but I can't figure out why they're not visible on the map...
Calling MapboxTraffic.render() after setting styles seems to resolve the issue.
MapboxTraffic.render()
Or, add an event callback like this:
this._map.on("style.load", () => { this._mapboxTraffic.render(); });
Traffic layer disappears when changing base map style, like this for example:
The traffic layer's style, sources and layers are still loaded, but I can't figure out why they're not visible on the map...