diff options
Diffstat (limited to 'modern/src')
-rw-r--r-- | modern/src/map/Map.js | 13 | ||||
-rw-r--r-- | modern/src/map/mapStyles.js | 8 |
2 files changed, 12 insertions, 9 deletions
diff --git a/modern/src/map/Map.js b/modern/src/map/Map.js index 10630d8..d71a40b 100644 --- a/modern/src/map/Map.js +++ b/modern/src/map/Map.js @@ -8,10 +8,9 @@ import { SwitcherControl } from './switcher/switcher'; import deviceCategories from '../common/deviceCategories'; import { prepareIcon, loadImage } from './mapUtil'; import { - styleCarto, styleLocationIq, styleMapbox, styleMapTiler, styleOsm, + styleLocationIq, styleCarto, styleOsm, styleGmapsStreets, styleGmapsSatellite, styleGmapsHybrid } from './mapStyles'; import { useAttributePreference } from '../common/preferences'; -import palette from '../theme/palette'; import { useTranslation } from '../LocalizationProvider'; const element = document.createElement('div'); @@ -98,15 +97,11 @@ const Map = ({ children }) => { useEffect(() => { switcher.updateStyles([ { id: 'locationIqStreets', title: t('mapLocationIqStreets'), uri: styleLocationIq('streets', locationIqKey) }, - { id: 'locationIqEarth', title: t('mapLocationIqEarth'), uri: styleLocationIq('earth', locationIqKey) }, - { id: 'locationIqHybrid', title: t('mapLocationIqHybrid'), uri: styleLocationIq('hybrid', locationIqKey) }, { id: 'osm', title: t('mapOsm'), uri: styleOsm() }, { id: 'carto', title: t('mapCarto'), uri: styleCarto() }, - { id: 'mapboxStreets', title: t('mapMapboxStreets'), uri: styleMapbox('streets-v11') }, - { id: 'mapboxOutdoors', title: t('mapMapboxOutdoors'), uri: styleMapbox('outdoors-v11') }, - { id: 'mapboxSatellite', title: t('mapMapboxSatellite'), uri: styleMapbox('satellite-v9') }, - { id: 'mapTilerBasic', title: t('mapMapTilerBasic'), uri: styleMapTiler('basic', mapTilerKey) }, - { id: 'mapTilerHybrid', title: t('mapMapTilerHybrid'), uri: styleMapTiler('hybrid', mapTilerKey) }, + { id: 'gmapsStreets', title: t('mapGmapsStreets'), uri: styleGmapsStreets() }, + { id: 'gmapsSatellite', title: t('mapGmapsSatellite'), uri: styleGmapsSatellite() }, + { id: 'gmapsHybrid', title: t('mapGmapsHybrid'), uri: styleGmapsHybrid() }, ], 'locationIqStreets'); }, [mapTilerKey]); diff --git a/modern/src/map/mapStyles.js b/modern/src/map/mapStyles.js index 86813a1..a6e84fd 100644 --- a/modern/src/map/mapStyles.js +++ b/modern/src/map/mapStyles.js @@ -53,3 +53,11 @@ export const styleMapbox = (style) => `mapbox://styles/mapbox/${style}`; export const styleMapTiler = (style, key) => `https://api.maptiler.com/maps/${style}/style.json?key=${key}`; export const styleLocationIq = (style, key) => `https://tiles.locationiq.com/v3/${style}/vector.json?key=${key}`; + +// Google Maps + +export const styleGmapsStreets = () => styleCustom('https://mt0.google.com/vt/lyrs=m&hl=en&x={x}&y={y}&z={z}&s=Ga', ''); + +export const styleGmapsSatellite = () => styleCustom('https://mt0.google.com/vt/lyrs=s&hl=en&x={x}&y={y}&z={z}&s=Ga', ''); + +export const styleGmapsHybrid = () => styleCustom('https://mt0.google.com/vt/lyrs=y&hl=en&x={x}&y={y}&z={z}&s=Ga', ''); |