From 4c257adfff88269c244608229810519408e1db6a Mon Sep 17 00:00:00 2001 From: Willem Grobler Date: Tue, 21 Jun 2022 17:34:12 +0000 Subject: added Mapbox as mapCustom --- modern/src/map/core/useMapStyles.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'modern/src/map/core') diff --git a/modern/src/map/core/useMapStyles.js b/modern/src/map/core/useMapStyles.js index 8f1423f1..72f18ebc 100644 --- a/modern/src/map/core/useMapStyles.js +++ b/modern/src/map/core/useMapStyles.js @@ -28,6 +28,7 @@ export default () => { const bingMapsKey = useAttributePreference('bingMapsKey'); const tomTomKey = useAttributePreference('tomTomKey'); const hereKey = useAttributePreference('hereKey'); + const mapboxAccessToken = useAttributePreference('mapboxAccessToken'); const customMapUrl = useSelector((state) => state.session.server?.mapUrl); return [ @@ -150,6 +151,33 @@ export default () => { ), available: true, }, + { + id: 'mapboxStreets', + title: t('mapMapboxStreets'), + style: styleCustom( + [`https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/{z}/{x}/{y}?access_token=${mapboxAccessToken}`], + ), + available: !!mapboxAccessToken, + attribute: 'mapboxAccessToken', + }, + { + id: 'mapboxOutdoors', + title: t('mapMapboxOutdoors'), + style: styleCustom( + [`https://api.mapbox.com/styles/v1/mapbox/outdoors-v11/tiles/{z}/{x}/{y}?access_token=${mapboxAccessToken}`], + ), + available: !!mapboxAccessToken, + attribute: 'mapboxAccessToken', + }, + { + id: 'mapboxSatelliteStreet', + title: t('mapMapboxSatellite'), + style: styleCustom( + [`https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/{z}/{x}/{y}?access_token=${mapboxAccessToken}`], + ), + available: !!mapboxAccessToken, + attribute: 'mapboxAccessToken', + }, { id: 'custom', title: t('mapCustom'), -- cgit v1.2.3