aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2022-06-21 10:57:01 -0700
committerGitHub <noreply@github.com>2022-06-21 10:57:01 -0700
commit6360be5047ef7a932522113e7c51b6f265d8d9b7 (patch)
tree02d6b974682dbb8d2a8d8b973f65bec74b05a0a4
parent2110974542f2700b5d801a540eded8e850be04aa (diff)
parent4c257adfff88269c244608229810519408e1db6a (diff)
downloadtrackermap-web-6360be5047ef7a932522113e7c51b6f265d8d9b7.tar.gz
trackermap-web-6360be5047ef7a932522113e7c51b6f265d8d9b7.tar.bz2
trackermap-web-6360be5047ef7a932522113e7c51b6f265d8d9b7.zip
Merge pull request #968 from WGrobler/update-mapStyles
Add Mapbox as mapCustom
-rw-r--r--modern/src/map/core/useMapStyles.js28
1 files changed, 28 insertions, 0 deletions
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 [
@@ -151,6 +152,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'),
style: styleCustom([customMapUrl]),