From 1111bb7388d1309fea0e6875d6cb3cc7f5941a4c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 24 Sep 2024 20:48:57 -0700 Subject: [PATCH] Add OpenFreeMap as default --- src/map/core/MapView.jsx | 4 ++-- src/map/core/useMapStyles.js | 6 ++++++ src/resources/l10n/en.json | 1 + src/settings/PreferencesPage.jsx | 2 +- src/settings/ServerPage.jsx | 2 +- src/settings/UserPage.jsx | 2 +- 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/map/core/MapView.jsx b/src/map/core/MapView.jsx index b48652f09c..c6d1718464 100644 --- a/src/map/core/MapView.jsx +++ b/src/map/core/MapView.jsx @@ -80,8 +80,8 @@ const MapView = ({ children }) => { const [mapReady, setMapReady] = useState(false); const mapStyles = useMapStyles(); - const activeMapStyles = useAttributePreference('activeMapStyles', 'locationIqStreets,osm,carto'); - const [defaultMapStyle] = usePersistedState('selectedMapStyle', usePreference('map', 'locationIqStreets')); + const activeMapStyles = useAttributePreference('activeMapStyles', 'openFreeMap,locationIqStreets,locationIqDark'); + const [defaultMapStyle] = usePersistedState('selectedMapStyle', usePreference('map', 'openFreeMap')); const mapboxAccessToken = useAttributePreference('mapboxAccessToken'); const maxZoom = useAttributePreference('web.maxZoom'); diff --git a/src/map/core/useMapStyles.js b/src/map/core/useMapStyles.js index 05f402d92a..f72a6a360d 100644 --- a/src/map/core/useMapStyles.js +++ b/src/map/core/useMapStyles.js @@ -40,6 +40,12 @@ export default () => { const customMapUrl = useSelector((state) => state.session.server.mapUrl); return useMemo(() => [ + { + id: 'openFreeMap', + title: t('mapOpenFreeMap'), + style: 'https://tiles.openfreemap.org/styles/liberty', + available: true, + }, { id: 'locationIqStreets', title: t('mapLocationIqStreets'), diff --git a/src/resources/l10n/en.json b/src/resources/l10n/en.json index 6e0d969602..3a7cd48553 100644 --- a/src/resources/l10n/en.json +++ b/src/resources/l10n/en.json @@ -382,6 +382,7 @@ "mapMapTilerBasic": "MapTiler Basic", "mapMapTilerHybrid": "MapTiler Hybrid", "mapMapTilerKey": "MapTiler API Key", + "mapOpenFreeMap": "OpenFreeMap", "mapLocationIqStreets": "LocationIQ Streets", "mapLocationIqDark": "LocationIQ Dark", "mapLocationIqKey": "LocationIQ Access Token", diff --git a/src/settings/PreferencesPage.jsx b/src/settings/PreferencesPage.jsx index a8e3de884b..ffd7e6e1eb 100644 --- a/src/settings/PreferencesPage.jsx +++ b/src/settings/PreferencesPage.jsx @@ -108,7 +108,7 @@ const PreferencesPage = () => { {t('mapActive')} setItem({ ...item, map: e.target.value })} > {mapStyles.filter((style) => style.available).map((style) => ( diff --git a/src/settings/UserPage.jsx b/src/settings/UserPage.jsx index e40e8e5151..289194a56e 100644 --- a/src/settings/UserPage.jsx +++ b/src/settings/UserPage.jsx @@ -187,7 +187,7 @@ const UserPage = () => { {t('mapDefault')}