Skip to content

Commit

Permalink
Add OpenFreeMap as default
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Sep 25, 2024
1 parent 87b7407 commit 1111bb7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/map/core/MapView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
6 changes: 6 additions & 0 deletions src/map/core/useMapStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
1 change: 1 addition & 0 deletions src/resources/l10n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/settings/PreferencesPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const PreferencesPage = () => {
<InputLabel>{t('mapActive')}</InputLabel>
<Select
label={t('mapActive')}
value={attributes.activeMapStyles?.split(',') || ['locationIqStreets', 'osm', 'carto']}
value={attributes.activeMapStyles?.split(',') || ['openFreeMap', 'locationIqStreets', 'locationIqDark']}
onChange={(e, child) => {
const clicked = mapStyles.find((s) => s.id === child.props.value);
if (clicked.available) {
Expand Down
2 changes: 1 addition & 1 deletion src/settings/ServerPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const ServerPage = () => {
<InputLabel>{t('mapDefault')}</InputLabel>
<Select
label={t('mapDefault')}
value={item.map || 'locationIqStreets'}
value={item.map || 'openFreeMap'}
onChange={(e) => setItem({ ...item, map: e.target.value })}
>
{mapStyles.filter((style) => style.available).map((style) => (
Expand Down
2 changes: 1 addition & 1 deletion src/settings/UserPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const UserPage = () => {
<InputLabel>{t('mapDefault')}</InputLabel>
<Select
label={t('mapDefault')}
value={item.map || 'locationIqStreets'}
value={item.map || 'openFreeMap'}
onChange={(e) => setItem({ ...item, map: e.target.value })}
>
{mapStyles.filter((style) => style.available).map((style) => (
Expand Down

0 comments on commit 1111bb7

Please sign in to comment.