diff options
Diffstat (limited to 'modern/src/map/core/useMapStyles.js')
-rw-r--r-- | modern/src/map/core/useMapStyles.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modern/src/map/core/useMapStyles.js b/modern/src/map/core/useMapStyles.js index 733d8d33..7c3412b5 100644 --- a/modern/src/map/core/useMapStyles.js +++ b/modern/src/map/core/useMapStyles.js @@ -1,3 +1,4 @@ +import { useMemo } from 'react'; import { useSelector } from 'react-redux'; import { useTranslation } from '../../common/components/LocalizationProvider'; import { useAttributePreference } from '../../common/util/preferences'; @@ -37,7 +38,7 @@ export default () => { const mapboxAccessToken = useAttributePreference('mapboxAccessToken'); const customMapUrl = useSelector((state) => state.session.server.mapUrl); - return [ + return useMemo(() => [ { id: 'locationIqStreets', title: t('mapLocationIqStreets'), @@ -254,5 +255,5 @@ export default () => { }), available: !!customMapUrl, }, - ]; + ], [t, mapTilerKey, locationIqKey, bingMapsKey, tomTomKey, hereKey, mapboxAccessToken, customMapUrl]); }; |