aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/core/MapView.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/map/core/MapView.js')
-rw-r--r--modern/src/map/core/MapView.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/modern/src/map/core/MapView.js b/modern/src/map/core/MapView.js
index 7f183346..1e16e4dc 100644
--- a/modern/src/map/core/MapView.js
+++ b/modern/src/map/core/MapView.js
@@ -74,17 +74,17 @@ const MapView = ({ children }) => {
const [mapReady, setMapReady] = useState(false);
+ const mapStyles = useMapStyles();
const [defaultMapLayer] = usePersistedState('mapLayer', 'locationIqStreets');
const mapboxAccessToken = useAttributePreference('mapboxAccessToken');
- const mapStyles = useMapStyles();
-
useEffect(() => {
maplibregl.accessToken = mapboxAccessToken;
}, [mapboxAccessToken]);
useEffect(() => {
- switcher.updateStyles(mapStyles, defaultMapLayer);
+ const filteredStyles = mapStyles.filter((style) => style.available);
+ switcher.updateStyles(filteredStyles, defaultMapLayer);
}, [mapStyles, defaultMapLayer]);
useEffect(() => {