From 12ae32b69e689de55bb2c88bd656b821843f935d Mon Sep 17 00:00:00 2001 From: Maurice Date: Fri, 13 Nov 2026 09:44:33 +0100 Subject: [PATCH] feat(map): setting to hide the Mapbox basemap points of interest (#1761) Mapbox Standard labels shops, restaurants and sights of its own; they look like trip places but cannot be picked. A Hide Points of Interest switch next to the other Mapbox options, on the desktop and the phone, turns them off on the trip map and the preview without a rebuild. The Standard config handling moves into useStandardBasemapConfig. --- client/scripts/size-baseline.json | 2 +- client/src/components/Map/MapViewGL.tsx | 15 ++--- .../Map/useStandardBasemapConfig.test.ts | 60 +++++++++++++++++++ .../Map/useStandardBasemapConfig.ts | 50 ++++++++++++++++ .../Settings/MapSettingsTab.test.tsx | 21 ++++++- .../components/Settings/MapSettingsTab.tsx | 9 ++- .../Settings/MapboxPreview.test.tsx | 16 ++++- .../src/components/Settings/MapboxPreview.tsx | 8 ++- .../Settings/useMapSettingsForm.test.ts | 10 ++++ .../components/Settings/useMapSettingsForm.ts | 8 ++- .../mobile/screens/settings/MSettingsMap.tsx | 8 ++- client/src/types.ts | 2 + .../mobile/settings/MSettingsMap.test.tsx | 20 ++++++- shared/src/i18n/ar/settings.ts | 3 + shared/src/i18n/az/settings.ts | 3 + shared/src/i18n/br/settings.ts | 3 + shared/src/i18n/ca/settings.ts | 3 + shared/src/i18n/cs/settings.ts | 3 + shared/src/i18n/de/settings.ts | 3 + shared/src/i18n/en/settings.ts | 3 + shared/src/i18n/es/settings.ts | 3 + shared/src/i18n/et/settings.ts | 3 + shared/src/i18n/fr/settings.ts | 3 + shared/src/i18n/gr/settings.ts | 3 + shared/src/i18n/he/settings.ts | 3 + shared/src/i18n/hu/settings.ts | 3 + shared/src/i18n/id/settings.ts | 3 + shared/src/i18n/it/settings.ts | 3 + shared/src/i18n/ja/settings.ts | 3 + shared/src/i18n/ko/settings.ts | 3 + shared/src/i18n/nl/settings.ts | 3 + shared/src/i18n/pl/settings.ts | 3 + shared/src/i18n/ru/settings.ts | 3 + shared/src/i18n/sk/settings.ts | 3 + shared/src/i18n/sv/settings.ts | 3 + shared/src/i18n/th/settings.ts | 3 + shared/src/i18n/tr/settings.ts | 3 + shared/src/i18n/uk/settings.ts | 3 + shared/src/i18n/vi/settings.ts | 3 + shared/src/i18n/zh-TW/settings.ts | 2 + shared/src/i18n/zh/settings.ts | 2 + wiki/Map-Settings.md | 6 +- wiki/User-Settings.md | 1 + 43 files changed, 294 insertions(+), 24 deletions(-) create mode 100644 client/src/components/Map/useStandardBasemapConfig.test.ts create mode 100644 client/src/components/Map/useStandardBasemapConfig.ts diff --git a/client/scripts/size-baseline.json b/client/scripts/size-baseline.json index 31fb619e0..978a06062 100644 --- a/client/scripts/size-baseline.json +++ b/client/scripts/size-baseline.json @@ -7,7 +7,7 @@ "src/components/Budget/CostsPanel.tsx": 1607, "src/components/Map/MapView.tsx": 1200, "src/components/Map/MapViewGL.test.tsx": 2919, - "src/components/Map/MapViewGL.tsx": 2126, + "src/components/Map/MapViewGL.tsx": 2118, "src/components/Planner/DayDetailPanel.test.tsx": 2333, "src/components/Planner/DayPlanSidebar.test.tsx": 5349, "src/components/Planner/DayPlanSidebar.tsx": 2910, diff --git a/client/src/components/Map/MapViewGL.tsx b/client/src/components/Map/MapViewGL.tsx index ca856b713..532aef4f2 100644 --- a/client/src/components/Map/MapViewGL.tsx +++ b/client/src/components/Map/MapViewGL.tsx @@ -26,7 +26,8 @@ import { ReservationMapboxOverlay } from './reservationsMapbox' import { useTransportRoutes } from '../../hooks/useTransportRoutes' import { visibleRouteReservations } from '../../utils/reservationRoutes' import { safeHexColor } from '../../utils/safeColor' -import { MAPBOX_DEFAULT_STYLE, styleForActiveProvider, basemapLanguage, type GlMapProvider } from './glProviders' +import { MAPBOX_DEFAULT_STYLE, styleForActiveProvider, type GlMapProvider } from './glProviders' +import { useStandardBasemapConfig } from './useStandardBasemapConfig' import { buildGlMap, initialMapStyle } from './glSupport' import { mapboxTileCacheRequest, tileCacheActive } from '../../native/tileCache' import LocationButton from './LocationButton' @@ -450,7 +451,6 @@ export function MapViewGL({ const mapbox3d = useSettingsStore(s => s.settings.mapbox_3d_enabled !== false) const mapboxQuality = useSettingsStore(s => s.settings.mapbox_quality_mode === true) const showEndpointLabels = useSettingsStore(s => s.settings.map_booking_labels) === true - const mapLang = useSettingsStore(s => s.settings.language) const isMapLibre = glProvider === 'maplibre-gl' const glStyle = styleOverride ?? styleForActiveProvider(glProvider, rawMapboxStyle, rawMaplibreStyle) const enableMapbox3d = !isMapLibre && mapbox3d @@ -1452,15 +1452,8 @@ export function MapViewGL({ } }, [glProvider, glStyle, mapboxToken, enableMapbox3d, mapboxQuality]) // rebuild on provider/style changes only - // Pin the basemap label language to the UI language so labels don't fall back to the - // browser/OS locale and stack multiple scripts per place (e.g. "India/भारत/India", #1299). - // Mapbox Standard exposes this via a basemap config property; classic and MapLibre styles - // are left as-is. Runs on load (mapReady) and whenever the UI language changes. - useEffect(() => { - const map = mapRef.current - if (!map || !mapReady || isMapLibre || !isStandardFamily(glStyle)) return - try { map.setConfigProperty('basemap', 'language', basemapLanguage(mapLang)) } catch { /* style/SDK may not support the basemap language property */ } - }, [mapLang, mapReady, isMapLibre, glStyle]) + // The label language (#1299) and the basemap's own points of interest (#1761) on Mapbox Standard. + useStandardBasemapConfig(mapRef, mapReady, !isMapLibre && isStandardFamily(glStyle)) // Photo loading, shared with the Leaflet MapView. const photoUrls = useMarkerThumbs(places) diff --git a/client/src/components/Map/useStandardBasemapConfig.test.ts b/client/src/components/Map/useStandardBasemapConfig.test.ts new file mode 100644 index 000000000..4033b0e01 --- /dev/null +++ b/client/src/components/Map/useStandardBasemapConfig.test.ts @@ -0,0 +1,60 @@ +import { act, renderHook } from '@testing-library/react'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; + +import { buildSettings } from '../../../tests/helpers/factories'; +import { resetAllStores, seedStore } from '../../../tests/helpers/store'; +import { useSettingsStore } from '../../store/settingsStore'; +import type { Settings } from '../../types'; +import { setBasemapConfig, useStandardBasemapConfig } from './useStandardBasemapConfig'; + +const map = { setConfigProperty: vi.fn() }; +const mapRef = { current: map }; + +function settle(patch: Partial) { + act(() => { + useSettingsStore.setState({ settings: { ...useSettingsStore.getState().settings, ...patch } }); + }); +} + +beforeEach(() => { + resetAllStores(); + map.setConfigProperty.mockReset(); + seedStore(useSettingsStore, { settings: buildSettings({ language: 'de' }) }); +}); + +describe('useStandardBasemapConfig', () => { + it('FE-MAP-BASEMAPCFG-001: a ready Standard map gets the label language and keeps its points of interest', () => { + renderHook(() => useStandardBasemapConfig(mapRef, true, true)); + + expect(map.setConfigProperty).toHaveBeenCalledWith('basemap', 'language', 'de'); + expect(map.setConfigProperty).toHaveBeenCalledWith('basemap', 'showPointOfInterestLabels', true); + }); + + it('FE-MAP-BASEMAPCFG-002: the setting hides the points of interest and shows them again, without a rebuild (#1761)', () => { + renderHook(() => useStandardBasemapConfig(mapRef, true, true)); + map.setConfigProperty.mockClear(); + + settle({ map_hide_basemap_pois: true }); + expect(map.setConfigProperty).toHaveBeenCalledWith('basemap', 'showPointOfInterestLabels', false); + // The language is left alone by a change that is not about it. + expect(map.setConfigProperty).not.toHaveBeenCalledWith('basemap', 'language', expect.anything()); + + settle({ map_hide_basemap_pois: false }); + expect(map.setConfigProperty).toHaveBeenLastCalledWith('basemap', 'showPointOfInterestLabels', true); + }); + + it('FE-MAP-BASEMAPCFG-003: nothing is set before the map is ready or on a style without that config', () => { + const { rerender } = renderHook(({ ready, standard }) => useStandardBasemapConfig(mapRef, ready, standard), { + initialProps: { ready: false, standard: true }, + }); + rerender({ ready: true, standard: false }); + expect(map.setConfigProperty).not.toHaveBeenCalled(); + }); + + it('FE-MAP-BASEMAPCFG-004: a style or SDK that refuses the property is passed over', () => { + map.setConfigProperty.mockImplementation(() => { + throw new Error('unknown config'); + }); + expect(() => setBasemapConfig(map, 'showPointOfInterestLabels', false)).not.toThrow(); + }); +}); diff --git a/client/src/components/Map/useStandardBasemapConfig.ts b/client/src/components/Map/useStandardBasemapConfig.ts new file mode 100644 index 000000000..37f2f1838 --- /dev/null +++ b/client/src/components/Map/useStandardBasemapConfig.ts @@ -0,0 +1,50 @@ +import { useEffect, type RefObject } from 'react'; + +import { useSettingsStore } from '../../store/settingsStore'; +import { basemapLanguage } from './glProviders'; + +/** The one call of a Mapbox map this needs; a MapLibre map never gets here. */ +interface BasemapConfigurable { + setConfigProperty: (importId: string, name: string, value: unknown) => unknown; +} + +/** Sets one property of a Mapbox Standard basemap's config, where the style has it. */ +export function setBasemapConfig(map: BasemapConfigurable, name: string, value: unknown): void { + try { + map.setConfigProperty('basemap', name, value); + } catch { + /* a style or SDK without this basemap config property */ + } +} + +/** + * The user's settings on a Mapbox Standard basemap's own config, set without rebuilding + * the map: once it is ready, and again whenever a setting changes. + * + * The label language follows the UI language, so labels don't fall back to the browser + * or OS locale and stack several scripts per place (#1299). The basemap's own points of + * interest can be hidden (#1761): Standard labels shops, restaurants and sights of its + * own, which look like the trip's places but cannot be picked and sit a little off the + * same place added from the search. Classic Mapbox styles and MapLibre have no such + * config and are left as they are (`standard` is false for them). + */ +export function useStandardBasemapConfig( + mapRef: RefObject, + ready: boolean, + standard: boolean +): void { + const language = useSettingsStore((s) => s.settings.language); + const hidePois = useSettingsStore((s) => s.settings.map_hide_basemap_pois === true); + + useEffect(() => { + const map = mapRef.current; + if (!map || !ready || !standard) return; + setBasemapConfig(map, 'language', basemapLanguage(language)); + }, [mapRef, ready, standard, language]); + + useEffect(() => { + const map = mapRef.current; + if (!map || !ready || !standard) return; + setBasemapConfig(map, 'showPointOfInterestLabels', !hidePois); + }, [mapRef, ready, standard, hidePois]); +} diff --git a/client/src/components/Settings/MapSettingsTab.test.tsx b/client/src/components/Settings/MapSettingsTab.test.tsx index fe8a43446..7969d0846 100644 --- a/client/src/components/Settings/MapSettingsTab.test.tsx +++ b/client/src/components/Settings/MapSettingsTab.test.tsx @@ -1,4 +1,4 @@ -// FE-COMP-MAP-001 to FE-COMP-MAP-035 +// FE-COMP-MAP-001 to FE-COMP-MAP-036 import { render, screen, waitFor, within, fireEvent } from '../../../tests/helpers/render'; import userEvent from '@testing-library/user-event'; import { useAuthStore } from '../../store/authStore'; @@ -19,8 +19,8 @@ vi.mock('../Map/MapView', () => ({ // The GL preview boots a real mapbox/maplibre instance; the tab only cares that // it gets the right provider/style, so render those as data attributes. vi.mock('./MapboxPreview', () => ({ - default: ({ provider, style, token, enable3d, quality }: { - provider?: string; style: string; token?: string; enable3d: boolean; quality?: boolean; + default: ({ provider, style, token, enable3d, quality, hidePois }: { + provider?: string; style: string; token?: string; enable3d: boolean; quality?: boolean; hidePois?: boolean; }) => (
({ data-token={token} data-3d={String(enable3d)} data-quality={String(quality)} + data-hide-pois={String(hidePois)} /> ), })); @@ -467,4 +468,18 @@ describe('MapSettingsTab – CARTO key', () => { expect(screen.queryByText(/API KEY REQUIRED/)).not.toBeInTheDocument(); }); + + it('FE-COMP-MAP-036: under Mapbox the basemap points of interest can be hidden, in the preview and on save (#1761)', async () => { + const user = userEvent.setup(); + const updateSettings = vi.fn().mockResolvedValue(undefined); + seedStore(useSettingsStore, { settings: buildSettings(), updateSettings }); + render(); + + await user.click(screen.getByText('Mapbox GL')); + await user.click(screen.getByRole('button', { name: 'Hide Points of Interest' })); + expect(await screen.findByTestId('gl-preview')).toHaveAttribute('data-hide-pois', 'true'); + + await user.click(screen.getByText('Save Map')); + expect(updateSettings).toHaveBeenCalledWith(expect.objectContaining({ map_hide_basemap_pois: true })); + }); }); diff --git a/client/src/components/Settings/MapSettingsTab.tsx b/client/src/components/Settings/MapSettingsTab.tsx index 63304042c..98d34b6dd 100644 --- a/client/src/components/Settings/MapSettingsTab.tsx +++ b/client/src/components/Settings/MapSettingsTab.tsx @@ -132,7 +132,8 @@ export default function MapSettingsTab(): React.ReactElement { const { managed, presets, canMapbox, saving, provider, changeProvider, mapTileUrl, setMapTileUrl, mapboxToken, setMapboxToken, cartoKey, setCartoKey, cartoNeedsKey, mapboxStyle, setMapboxStyle, mapbox3d, setMapbox3d, - mapboxQuality, setMapboxQuality, previewPlaces, glPreview, webgl2Missing, save: saveMapSettings, + mapboxQuality, setMapboxQuality, hideBasemapPois, setHideBasemapPois, previewPlaces, glPreview, webgl2Missing, + save: saveMapSettings, } = useMapSettingsForm() // One chunk per engine — see components/Map/glLazy.tsx. const GlMapPreview = provider === 'maplibre-gl' ? GlMapPreviewMaplibre : GlMapPreviewMapbox @@ -307,6 +308,11 @@ export default function MapSettingsTab(): React.ReactElement { } control={ setMapboxQuality(!mapboxQuality)} label={t('settings.mapHighQuality')} />} /> + setHideBasemapPois(!hideBasemapPois)} label={t('settings.mapHidePois')} />} + />
@@ -337,6 +343,7 @@ export default function MapSettingsTab(): React.ReactElement { zoom={PREVIEW_ZOOM} enable3d={provider === 'mapbox-gl' && mapbox3d && supports3d} quality={provider === 'mapbox-gl' && mapboxQuality} + hidePois={provider === 'mapbox-gl' && hideBasemapPois} /> diff --git a/client/src/components/Settings/MapboxPreview.test.tsx b/client/src/components/Settings/MapboxPreview.test.tsx index 1b06aa1f1..f4e0fee86 100644 --- a/client/src/components/Settings/MapboxPreview.test.tsx +++ b/client/src/components/Settings/MapboxPreview.test.tsx @@ -1,4 +1,4 @@ -// FE-COMP-GLPREVIEW-001 to FE-COMP-GLPREVIEW-014 +// FE-COMP-GLPREVIEW-001 to FE-COMP-GLPREVIEW-015 import { render, screen, act } from '../../../tests/helpers/render'; type ClickHandler = (e: { lngLat: { lat: number; lng: number } }) => void; @@ -20,6 +20,7 @@ const glMap = vi.hoisted(() => ({ remove: vi.fn(), jumpTo: vi.fn(), setTerrain: vi.fn(), + setConfigProperty: vi.fn(), })); const mapboxCtor = vi.hoisted(() => vi.fn(function (_options: Record) { @@ -216,4 +217,17 @@ describe('GlMapPreview', () => { expect(() => unmount()).not.toThrow(); expect(glMap.remove).toHaveBeenCalled(); }); + + it('FE-COMP-GLPREVIEW-015: on a Standard style the preview hides the basemap points of interest when asked (#1761)', () => { + vi.mocked(isStandardFamily).mockReturnValue(true); + const { unmount } = render(); + act(() => glHandlers.load?.()); + expect(glMap.setConfigProperty).toHaveBeenCalledWith('basemap', 'showPointOfInterestLabels', false); + unmount(); + + glMap.setConfigProperty.mockClear(); + render(); + act(() => glHandlers.load?.()); + expect(glMap.setConfigProperty).not.toHaveBeenCalled(); + }); }); diff --git a/client/src/components/Settings/MapboxPreview.tsx b/client/src/components/Settings/MapboxPreview.tsx index 2021158dc..df403646a 100644 --- a/client/src/components/Settings/MapboxPreview.tsx +++ b/client/src/components/Settings/MapboxPreview.tsx @@ -2,6 +2,7 @@ import { useEffect, useRef } from 'react' import { isStandardFamily, supportsCustom3d, addCustom3dBuildings, addTerrainAndSky } from '../Map/mapboxSetup' import { MAPBOX_DEFAULT_STYLE, normalizeStyleForProvider, type GlMapProvider } from '../Map/glProviders' import { buildGlMap } from '../Map/glSupport' +import { setBasemapConfig } from '../Map/useStandardBasemapConfig' import { fs } from '../shared/DialogShell' interface Props { @@ -13,6 +14,8 @@ interface Props { zoom: number enable3d: boolean quality?: boolean + /** Leaves out Mapbox Standard's own points of interest, as the trip map does (#1761). */ + hidePois?: boolean onClick?: (latlng: { lat: number; lng: number }) => void /** * The GL engine, injected instead of imported. Both SDKs used to be pulled in @@ -23,7 +26,7 @@ interface Props { gl: any } -export default function GlMapPreview({ provider = 'mapbox-gl', token = '', style, lat, lng, zoom, enable3d, quality = false, onClick, gl }: Props) { +export default function GlMapPreview({ provider = 'mapbox-gl', token = '', style, lat, lng, zoom, enable3d, quality = false, hidePois = false, onClick, gl }: Props) { const containerRef = useRef(null) // eslint-disable-next-line @typescript-eslint/no-explicit-any const mapRef = useRef(null) @@ -67,6 +70,7 @@ export default function GlMapPreview({ provider = 'mapbox-gl', token = '', style if (glStyle === MAPBOX_DEFAULT_STYLE) { try { map.setTerrain(null) } catch { /* noop */ } } + if (hidePois && !isMapLibre && isStandardFamily(glStyle)) setBasemapConfig(map, 'showPointOfInterestLabels', false) }) map.on('click', (e) => { @@ -77,7 +81,7 @@ export default function GlMapPreview({ provider = 'mapbox-gl', token = '', style try { map.remove() } catch { /* noop */ } mapRef.current = null } - }, [provider, token, glStyle, enableMapbox3d, quality]) + }, [provider, token, glStyle, enableMapbox3d, quality, hidePois]) // Recenter without rebuilding the map when lat/lng/zoom change externally useEffect(() => { diff --git a/client/src/components/Settings/useMapSettingsForm.test.ts b/client/src/components/Settings/useMapSettingsForm.test.ts index 8ba662614..c1f5eb514 100644 --- a/client/src/components/Settings/useMapSettingsForm.test.ts +++ b/client/src/components/Settings/useMapSettingsForm.test.ts @@ -118,4 +118,14 @@ describe('useMapSettingsForm', () => { await act(() => result.current.save()); expect(toast.error).toHaveBeenCalledWith('common.error'); }); + + it('FE-COMP-MAPFORM-009: the basemap points of interest switch is read from the settings and saved back (#1761)', async () => { + seed({ map_provider: 'mapbox-gl', map_hide_basemap_pois: true }); + const { result } = renderHook(() => useMapSettingsForm()); + expect(result.current.hideBasemapPois).toBe(true); + + act(() => result.current.setHideBasemapPois(false)); + await act(() => result.current.save()); + expect(updateSettings).toHaveBeenCalledWith(expect.objectContaining({ map_hide_basemap_pois: false })); + }); }); diff --git a/client/src/components/Settings/useMapSettingsForm.ts b/client/src/components/Settings/useMapSettingsForm.ts index 0029d7c9d..6fc999228 100644 --- a/client/src/components/Settings/useMapSettingsForm.ts +++ b/client/src/components/Settings/useMapSettingsForm.ts @@ -28,7 +28,8 @@ export interface MapSettingsFormOptions { /** * The user's map settings form behind both settings shells (the desktop tab and the * phone section render their own markup over this): the provider, the raster tiles - * and CARTO key, the Mapbox token, the GL style and the 3D and quality toggles, + * and CARTO key, the Mapbox token, the GL style, the 3D and quality toggles and the switch + * for the basemap's own points of interest, * seeded from the settings store and saved back in one patch. */ export function useMapSettingsForm({ mirrorStyleBeforeSave = false }: MapSettingsFormOptions = {}) { @@ -48,6 +49,7 @@ export function useMapSettingsForm({ mirrorStyleBeforeSave = false }: MapSetting ); const [mapbox3d, setMapbox3d] = useState(settings.mapbox_3d_enabled !== false); const [mapboxQuality, setMapboxQuality] = useState(settings.mapbox_quality_mode === true); + const [hideBasemapPois, setHideBasemapPois] = useState(settings.map_hide_basemap_pois === true); useEffect(() => { const nextProvider = normalizeProvider(settings.map_provider); @@ -58,6 +60,7 @@ export function useMapSettingsForm({ mirrorStyleBeforeSave = false }: MapSetting setMapboxStyle(styleForProvider(nextProvider, slotStyle(nextProvider, settings))); setMapbox3d(settings.mapbox_3d_enabled !== false); setMapboxQuality(settings.mapbox_quality_mode === true); + setHideBasemapPois(settings.map_hide_basemap_pois === true); }, [settings]); const previewPlaces = useMemo((): Place[] => [previewPlace()], []); @@ -82,6 +85,7 @@ export function useMapSettingsForm({ mirrorStyleBeforeSave = false }: MapSetting ...stylePatch, mapbox_3d_enabled: mapbox3d, mapbox_quality_mode: mapboxQuality, + map_hide_basemap_pois: hideBasemapPois, }); // Only mirror the normalized style into the form once it is actually persisted. if (!mirrorStyleBeforeSave) setMapboxStyle(glStyle); @@ -121,6 +125,8 @@ export function useMapSettingsForm({ mirrorStyleBeforeSave = false }: MapSetting setMapbox3d, mapboxQuality, setMapboxQuality, + hideBasemapPois, + setHideBasemapPois, previewPlaces, glPreview, webgl2Missing, diff --git a/client/src/mobile/screens/settings/MSettingsMap.tsx b/client/src/mobile/screens/settings/MSettingsMap.tsx index aebd12e8e..240bbb643 100644 --- a/client/src/mobile/screens/settings/MSettingsMap.tsx +++ b/client/src/mobile/screens/settings/MSettingsMap.tsx @@ -22,7 +22,7 @@ export default function MSettingsMap() { const { managed, presets: tilePresets, canMapbox, saving, provider, changeProvider, mapTileUrl, setMapTileUrl, mapboxToken, setMapboxToken, cartoKey, setCartoKey, cartoNeedsKey, mapboxStyle, setMapboxStyle, mapbox3d, setMapbox3d, - mapboxQuality, setMapboxQuality, previewPlaces, glPreview, webgl2Missing, save, + mapboxQuality, setMapboxQuality, hideBasemapPois, setHideBasemapPois, previewPlaces, glPreview, webgl2Missing, save, } = useMapSettingsForm({ mirrorStyleBeforeSave: true }) const [presetOpen, setPresetOpen] = useState(false) const [styleOpen, setStyleOpen] = useState(false) @@ -161,6 +161,11 @@ export default function MSettingsMap() { sub={`${t('settings.mapHighQualityHint')} ${t('settings.mapHighQualityWarning')}`} trailing={} /> + } + />

{t('settings.mapTipLabel')} {t('settings.mapTip')}

@@ -183,6 +188,7 @@ export default function MSettingsMap() { zoom={PREVIEW_ZOOM} enable3d={provider === 'mapbox-gl' && mapbox3d} quality={provider === 'mapbox-gl' && mapboxQuality} + hidePois={provider === 'mapbox-gl' && hideBasemapPois} /> diff --git a/client/src/types.ts b/client/src/types.ts index c0538bf64..4c1e1e071 100644 --- a/client/src/types.ts +++ b/client/src/types.ts @@ -250,6 +250,8 @@ export interface Settings { maplibre_style?: string mapbox_3d_enabled?: boolean mapbox_quality_mode?: boolean + /** Leaves out the points of interest Mapbox Standard labels on its own (#1761); absent shows them. */ + map_hide_basemap_pois?: boolean // Dashboard widget prefs — persisted server-side so a (docker) upgrade keeps them (#1311). dashboard_fx_from?: string dashboard_fx_to?: string diff --git a/client/tests/unit/mobile/settings/MSettingsMap.test.tsx b/client/tests/unit/mobile/settings/MSettingsMap.test.tsx index 72660733b..792168192 100644 --- a/client/tests/unit/mobile/settings/MSettingsMap.test.tsx +++ b/client/tests/unit/mobile/settings/MSettingsMap.test.tsx @@ -16,8 +16,8 @@ vi.mock('../../../../src/components/Map/MapView', () => ({ MapView: ({ tileUrl }: { tileUrl: string }) =>
, })); vi.mock('../../../../src/components/Settings/MapboxPreview', () => ({ - default: ({ provider, token, style, enable3d, quality }: { - provider: string; token: string; style: string; enable3d: boolean; quality: boolean; + default: ({ provider, token, style, enable3d, quality, hidePois }: { + provider: string; token: string; style: string; enable3d: boolean; quality: boolean; hidePois?: boolean; }) => (
({ data-style={style} data-3d={String(enable3d)} data-quality={String(quality)} + data-hide-pois={String(hidePois)} /> ), })); @@ -204,6 +205,7 @@ describe('MSettingsMap', () => { mapbox_style: 'mapbox://styles/mapbox/dark-v11', mapbox_3d_enabled: true, mapbox_quality_mode: false, + map_hide_basemap_pois: false, }); await screen.findByText('Map settings saved'); }); @@ -335,4 +337,18 @@ describe('MSettingsMap', () => { expect(screen.queryByText(/API KEY REQUIRED/)).not.toBeInTheDocument(); }); + + it('FE-MOB-SETMAP-025: the switch for the basemap points of interest drives the preview and is saved (#1761)', async () => { + const user = userEvent.setup(); + const updateSettings = seedMap({ map_provider: 'mapbox-gl', mapbox_access_token: 'pk.token' }); + renderMap(); + + const toggle = screen.getByRole('switch', { name: 'Hide Points of Interest' }); + expect(toggle).toHaveAttribute('aria-checked', 'false'); + await user.click(toggle); + expect(await screen.findByTestId('gl-preview')).toHaveAttribute('data-hide-pois', 'true'); + + await user.click(screen.getByRole('button', { name: 'Save Map' })); + expect(updateSettings).toHaveBeenCalledWith(expect.objectContaining({ map_hide_basemap_pois: true })); + }); }); diff --git a/shared/src/i18n/ar/settings.ts b/shared/src/i18n/ar/settings.ts index 30ff11611..2ab45fd04 100644 --- a/shared/src/i18n/ar/settings.ts +++ b/shared/src/i18n/ar/settings.ts @@ -61,6 +61,9 @@ const settings: TranslationStrings = { 'settings.mapHighQuality': 'وضع الجودة العالية', 'settings.mapHighQualityHint': 'تحسين الحواف + إسقاط كروي لحواف أكثر حدة وعرض واقعي للعالم.', 'settings.mapHighQualityWarning': 'قد يؤثر على الأداء في الأجهزة الأقل قدرة.', + 'settings.mapHidePois': 'إخفاء نقاط الاهتمام', + 'settings.mapHidePoisHint': + 'يُخفي المتاجر والمطاعم والمعالم التي تضعها Mapbox من تلقاء نفسها، فتبرز أماكنك وحدها. لأنماط Standard فقط.', 'settings.mapTipLabel': 'نصيحة:', 'settings.mapTip': 'انقر بزر الماوس الأيمن واسحب لتدوير/إمالة الخريطة. النقر الأوسط لإضافة مكان (النقر الأيمن مخصص للتدوير).', diff --git a/shared/src/i18n/az/settings.ts b/shared/src/i18n/az/settings.ts index dac202db8..dd7fbc8e1 100644 --- a/shared/src/i18n/az/settings.ts +++ b/shared/src/i18n/az/settings.ts @@ -85,6 +85,9 @@ const settings: TranslationStrings = { 'settings.mapHighQuality': 'Yüksək keyfiyyət rejimi', 'settings.mapHighQualityHint': 'Daha kəskin kənarlar və real dünya görünüşü üçün hamarlama və qlobus proyeksiyası.', 'settings.mapHighQualityWarning': 'Zəif cihazlarda performansa təsir edə bilər.', + 'settings.mapHidePois': 'Maraqlı məkanları gizlət', + 'settings.mapHidePoisHint': + 'Mapbox-un özünün göstərdiyi mağaza, restoran və görməli yerləri gizlədir ki, yalnız sənin məkanların seçilsin. Yalnız Standard üslubları üçün.', 'settings.mapTipLabel': 'İpucu:', 'settings.mapTip': 'xəritəni fırlatmaq və əymək üçün sağ kliklə sürükləyin. Məkan əlavə etmək üçün orta düymə ilə klikləyin (sağ klik fırlatma üçün ayrılıb).', diff --git a/shared/src/i18n/br/settings.ts b/shared/src/i18n/br/settings.ts index a2b196658..849f61593 100644 --- a/shared/src/i18n/br/settings.ts +++ b/shared/src/i18n/br/settings.ts @@ -68,6 +68,9 @@ const settings: TranslationStrings = { 'settings.mapHighQualityHint': 'Antialiasing + projeção global para bordas mais nítidas e uma visão realista do mundo.', 'settings.mapHighQualityWarning': 'Pode afetar o desempenho em dispositivos menos potentes.', + 'settings.mapHidePois': 'Ocultar pontos de interesse', + 'settings.mapHidePoisHint': + 'Oculta as lojas, restaurantes e atrações que o Mapbox marca por conta própria, para que só os seus lugares se destaquem. Só nos estilos Standard.', 'settings.mapTipLabel': 'Dica:', 'settings.mapTip': 'Clique direito e arraste para girar/inclinar o mapa. Clique do meio para adicionar um local (o clique direito é reservado para rotação).', diff --git a/shared/src/i18n/ca/settings.ts b/shared/src/i18n/ca/settings.ts index e2688d371..67a1b18a4 100644 --- a/shared/src/i18n/ca/settings.ts +++ b/shared/src/i18n/ca/settings.ts @@ -54,6 +54,9 @@ const settings: TranslationStrings = { 'settings.mapHighQuality': "Mode d'alta qualitat", 'settings.mapHighQualityHint': 'Antialiàsia + projecció global per a vores més nítides i una vista realista del món.', 'settings.mapHighQualityWarning': 'Pot afectar el rendiment en dispositius menys potents.', + 'settings.mapHidePois': "Amaga els punts d'interès", + 'settings.mapHidePoisHint': + "Amaga les botigues, restaurants i llocs d'interès que Mapbox marca pel seu compte, perquè només destaquin els teus llocs. Només als estils Standard.", 'settings.mapTipLabel': 'Consell:', 'settings.mapTip': 'Clic dret i arrossegar per girar/inclinar el mapa. Clic central per afegir un lloc (el clic dret està reservat per a la rotació).', diff --git a/shared/src/i18n/cs/settings.ts b/shared/src/i18n/cs/settings.ts index 19fdcfafa..ec4c8746f 100644 --- a/shared/src/i18n/cs/settings.ts +++ b/shared/src/i18n/cs/settings.ts @@ -65,6 +65,9 @@ const settings: TranslationStrings = { 'settings.mapHighQuality': 'Režim vysoké kvality', 'settings.mapHighQualityHint': 'Antialiasing + zobrazení glóbu pro ostřejší hrany a realistický pohled na svět.', 'settings.mapHighQualityWarning': 'Může ovlivnit výkon na slabších zařízeních.', + 'settings.mapHidePois': 'Skrýt body zájmu', + 'settings.mapHidePoisHint': + 'Skryje obchody, restaurace a památky, které Mapbox označuje sám, aby vynikla jen tvoje místa. Jen pro styly Standard.', 'settings.mapTipLabel': 'Tip:', // same-as-en 'settings.mapTip': 'Pravé tlačítko myši a táhněte pro rotaci/náklon mapy. Prostřední tlačítko pro přidání místa (pravé tlačítko je vyhrazeno pro rotaci).', diff --git a/shared/src/i18n/de/settings.ts b/shared/src/i18n/de/settings.ts index d8b4ccc35..cf9b30035 100644 --- a/shared/src/i18n/de/settings.ts +++ b/shared/src/i18n/de/settings.ts @@ -67,6 +67,9 @@ const settings: TranslationStrings = { 'settings.mapHighQualityHint': 'Antialiasing + Globus-Projektion für schärfere Kanten und eine realistische Weltsicht.', 'settings.mapHighQualityWarning': 'Kann die Performance auf schwächeren Geräten beeinträchtigen.', + 'settings.mapHidePois': 'Points of Interest ausblenden', + 'settings.mapHidePoisHint': + 'Blendet die Geschäfte, Restaurants und Sehenswürdigkeiten aus, die Mapbox selbst beschriftet, damit nur deine Orte hervortreten. Nur bei den Standard-Stilen.', 'settings.mapTipLabel': 'Tipp:', 'settings.mapTip': 'Rechtsklick und ziehen, um die Karte zu drehen/neigen. Mittelklick, um einen Ort hinzuzufügen (Rechtsklick ist für die Rotation reserviert).', diff --git a/shared/src/i18n/en/settings.ts b/shared/src/i18n/en/settings.ts index 2461678c2..ee2e9249f 100644 --- a/shared/src/i18n/en/settings.ts +++ b/shared/src/i18n/en/settings.ts @@ -74,6 +74,9 @@ const settings: TranslationStrings = { 'settings.mapHighQuality': 'High Quality Mode', 'settings.mapHighQualityHint': 'Antialiasing + globe projection for sharper edges and a realistic world view.', 'settings.mapHighQualityWarning': 'May impact performance on lower-end devices.', + 'settings.mapHidePois': 'Hide Points of Interest', + 'settings.mapHidePoisHint': + 'Leaves out the shops, restaurants and sights Mapbox labels on its own, so only your places stand out. Standard styles only.', 'settings.mapTipLabel': 'Tip:', 'settings.mapTip': 'right-click and drag to rotate/pitch the map. Middle-click to add a place (right-click is reserved for rotation).', diff --git a/shared/src/i18n/es/settings.ts b/shared/src/i18n/es/settings.ts index b82010266..cffcec68a 100644 --- a/shared/src/i18n/es/settings.ts +++ b/shared/src/i18n/es/settings.ts @@ -68,6 +68,9 @@ const settings: TranslationStrings = { 'settings.mapHighQualityHint': 'Antialiasing + proyección global para bordes más nítidos y una vista realista del mundo.', 'settings.mapHighQualityWarning': 'Puede afectar el rendimiento en dispositivos menos potentes.', + 'settings.mapHidePois': 'Ocultar puntos de interés', + 'settings.mapHidePoisHint': + 'Oculta las tiendas, restaurantes y lugares de interés que Mapbox marca por su cuenta, para que solo destaquen tus lugares. Solo en los estilos Standard.', 'settings.mapTipLabel': 'Consejo:', 'settings.mapTip': 'Clic derecho y arrastrar para rotar/inclinar el mapa. Clic central para añadir un lugar (el clic derecho está reservado para la rotación).', diff --git a/shared/src/i18n/et/settings.ts b/shared/src/i18n/et/settings.ts index 46ad6a19c..dd48d4730 100644 --- a/shared/src/i18n/et/settings.ts +++ b/shared/src/i18n/et/settings.ts @@ -76,6 +76,9 @@ const settings: TranslationStrings = { 'settings.mapHighQualityHint': 'Servade silumine ja gloobuse projektsioon selgemate servade ning realistliku maailmavaate jaoks.', 'settings.mapHighQualityWarning': 'Võib nõrgemates seadmetes jõudlust vähendada.', + 'settings.mapHidePois': 'Peida huvipunktid', + 'settings.mapHidePoisHint': + 'Peidab poed, restoranid ja vaatamisväärsused, mida Mapbox ise märgib, et esile tõuseksid ainult sinu kohad. Ainult Standard-stiilidel.', 'settings.mapTipLabel': 'Vihje:', 'settings.mapTip': 'kaardi pööramiseks või kallutamiseks lohista paremat hiirenuppu all hoides. Koha lisamiseks kasuta keskmist klõpsu (paremklõps on pööramiseks).', diff --git a/shared/src/i18n/fr/settings.ts b/shared/src/i18n/fr/settings.ts index 69ce6909c..ef1a4a418 100644 --- a/shared/src/i18n/fr/settings.ts +++ b/shared/src/i18n/fr/settings.ts @@ -69,6 +69,9 @@ const settings: TranslationStrings = { 'settings.mapHighQualityHint': 'Anticrénelage + projection globe pour des bords plus nets et une vue réaliste du monde.', 'settings.mapHighQualityWarning': 'Peut affecter les performances sur les appareils moins puissants.', + 'settings.mapHidePois': 'Masquer les points d’intérêt', + 'settings.mapHidePoisHint': + 'Masque les boutiques, restaurants et sites que Mapbox affiche de lui-même, pour que seuls tes lieux ressortent. Styles Standard uniquement.', 'settings.mapTipLabel': 'Astuce :', 'settings.mapTip': 'Clic droit et glisser pour pivoter/incliner la carte. Clic milieu pour ajouter un lieu (le clic droit est réservé à la rotation).', diff --git a/shared/src/i18n/gr/settings.ts b/shared/src/i18n/gr/settings.ts index d23addcfe..de5da6426 100644 --- a/shared/src/i18n/gr/settings.ts +++ b/shared/src/i18n/gr/settings.ts @@ -71,6 +71,9 @@ const settings: TranslationStrings = { 'settings.mapHighQualityHint': 'Antialiasing + προβολή υδρογείου για ευκρινέστερες ακμές και ρεαλιστική όψη του κόσμου.', 'settings.mapHighQualityWarning': 'Μπορεί να επηρεάσει την απόδοση σε συσκευές χαμηλότερων προδιαγραφών.', + 'settings.mapHidePois': 'Απόκρυψη σημείων ενδιαφέροντος', + 'settings.mapHidePoisHint': + 'Κρύβει τα καταστήματα, τα εστιατόρια και τα αξιοθέατα που σημειώνει μόνο του το Mapbox, ώστε να ξεχωρίζουν μόνο τα δικά σου μέρη. Μόνο για τα στυλ Standard.', 'settings.mapTipLabel': 'Συμβουλή:', 'settings.mapTip': 'κάντε δεξί κλικ και σύρετε για περιστροφή/κλίση του χάρτη. Μεσαίο κλικ για προσθήκη τοποθεσίας (το δεξί κλικ έχει κρατηθεί για περιστροφή).', diff --git a/shared/src/i18n/he/settings.ts b/shared/src/i18n/he/settings.ts index f98bada3e..499cb7862 100644 --- a/shared/src/i18n/he/settings.ts +++ b/shared/src/i18n/he/settings.ts @@ -75,6 +75,9 @@ const settings: TranslationStrings = { 'settings.mapHighQuality': 'מצב איכות גבוהה', 'settings.mapHighQualityHint': 'החלקת קצוות והקרנת גלובוס לקצוות חדים יותר ותצוגת עולם מציאותית.', 'settings.mapHighQualityWarning': 'עלול להשפיע על הביצועים במכשירים חלשים.', + 'settings.mapHidePois': 'הסתרת נקודות עניין', + 'settings.mapHidePoisHint': + 'מסתיר את החנויות, המסעדות והאטרקציות ש-Mapbox מסמן בעצמו, כך שרק המקומות שלכם בולטים. רק בסגנונות Standard.', 'settings.mapTipLabel': 'טיפ:', 'settings.mapTip': 'לחיצה ימנית וגרירה מסובבות/מטות את המפה. לחיצה אמצעית מוסיפה מקום (הלחיצה הימנית שמורה לסיבוב).', 'settings.saveMap': 'שמירת המפה', diff --git a/shared/src/i18n/hu/settings.ts b/shared/src/i18n/hu/settings.ts index 480a4eb4c..63b92a090 100644 --- a/shared/src/i18n/hu/settings.ts +++ b/shared/src/i18n/hu/settings.ts @@ -68,6 +68,9 @@ const settings: TranslationStrings = { 'settings.mapHighQualityHint': 'Antialiasing + földgömb-vetítés az élesebb kontúrokért és egy valósághű világnézethez.', 'settings.mapHighQualityWarning': 'Gyengébb eszközökön befolyásolhatja a teljesítményt.', + 'settings.mapHidePois': 'Érdekes helyek elrejtése', + 'settings.mapHidePoisHint': + 'Elrejti az üzleteket, éttermeket és látnivalókat, amelyeket a Mapbox magától jelöl, így csak a saját helyeid tűnnek ki. Csak a Standard stílusoknál.', 'settings.mapTipLabel': 'Tipp:', 'settings.mapTip': 'Jobb klikk és húzás a térkép forgatásához/döntéséhez. Középső kattintás hely hozzáadásához (a jobb klikk a forgatáshoz van fenntartva).', diff --git a/shared/src/i18n/id/settings.ts b/shared/src/i18n/id/settings.ts index 4b78664fc..02ac15099 100644 --- a/shared/src/i18n/id/settings.ts +++ b/shared/src/i18n/id/settings.ts @@ -66,6 +66,9 @@ const settings: TranslationStrings = { 'settings.mapHighQualityHint': 'Antialiasing + proyeksi globe untuk tepi yang lebih tajam dan tampilan dunia realistis.', 'settings.mapHighQualityWarning': 'Dapat memengaruhi performa pada perangkat kelas bawah.', + 'settings.mapHidePois': 'Sembunyikan tempat menarik', + 'settings.mapHidePoisHint': + 'Menyembunyikan toko, restoran, dan objek wisata yang ditandai Mapbox sendiri, agar hanya tempatmu yang menonjol. Hanya untuk gaya Standard.', 'settings.mapTipLabel': 'Tips:', 'settings.mapTip': 'Klik kanan dan seret untuk memutar/memiringkan peta. Klik tengah untuk menambah tempat (klik kanan untuk rotasi).', diff --git a/shared/src/i18n/it/settings.ts b/shared/src/i18n/it/settings.ts index 4f1fee311..54e91a3e9 100644 --- a/shared/src/i18n/it/settings.ts +++ b/shared/src/i18n/it/settings.ts @@ -68,6 +68,9 @@ const settings: TranslationStrings = { 'settings.mapHighQualityHint': 'Antialiasing + proiezione globo per bordi più nitidi e una vista realistica del mondo.', 'settings.mapHighQualityWarning': 'Può influire sulle prestazioni su dispositivi meno potenti.', + 'settings.mapHidePois': 'Nascondi punti di interesse', + 'settings.mapHidePoisHint': + 'Nasconde negozi, ristoranti e attrazioni che Mapbox segna da sé, così risaltano solo i tuoi luoghi. Solo con gli stili Standard.', 'settings.mapTipLabel': 'Suggerimento:', 'settings.mapTip': 'Click destro e trascina per ruotare/inclinare la mappa. Click centrale per aggiungere un luogo (il click destro è riservato alla rotazione).', diff --git a/shared/src/i18n/ja/settings.ts b/shared/src/i18n/ja/settings.ts index bcde13a15..2dcd158c4 100644 --- a/shared/src/i18n/ja/settings.ts +++ b/shared/src/i18n/ja/settings.ts @@ -66,6 +66,9 @@ const settings: TranslationStrings = { 'settings.mapHighQuality': '高品質モード', 'settings.mapHighQualityHint': 'アンチエイリアス+地球投影で、より鮮明でリアルに表示。', 'settings.mapHighQualityWarning': '低性能デバイスではパフォーマンスに影響する場合があります。', + 'settings.mapHidePois': 'スポットを非表示', + 'settings.mapHidePoisHint': + 'Mapbox が独自に表示するお店、レストラン、観光地を隠し、あなたの場所だけを目立たせます。Standard スタイルのみ。', 'settings.mapTipLabel': 'ヒント:', 'settings.mapTip': '右クリック+ドラッグで回転/傾き。中クリックで場所を追加(右クリックは回転用)。', 'settings.saveMap': '地図を保存', diff --git a/shared/src/i18n/ko/settings.ts b/shared/src/i18n/ko/settings.ts index f490c3cce..079cdefd4 100644 --- a/shared/src/i18n/ko/settings.ts +++ b/shared/src/i18n/ko/settings.ts @@ -66,6 +66,9 @@ const settings: TranslationStrings = { 'settings.mapHighQuality': '고품질 모드', 'settings.mapHighQualityHint': '안티앨리어싱 + 구형 투영으로 선명한 경계와 현실적인 지구 뷰를 제공합니다.', 'settings.mapHighQualityWarning': '저사양 기기에서 성능에 영향을 줄 수 있습니다.', + 'settings.mapHidePois': '관심 지점 숨기기', + 'settings.mapHidePoisHint': + 'Mapbox가 자체적으로 표시하는 상점, 식당, 명소를 숨겨 내 장소만 돋보이게 합니다. Standard 스타일에서만.', 'settings.mapTipLabel': '팁:', 'settings.mapTip': '우클릭 후 드래그하여 지도를 회전/기울이세요. 가운데 클릭으로 장소를 추가할 수 있습니다 (우클릭은 회전 전용).', diff --git a/shared/src/i18n/nl/settings.ts b/shared/src/i18n/nl/settings.ts index c62f46c9e..e61195646 100644 --- a/shared/src/i18n/nl/settings.ts +++ b/shared/src/i18n/nl/settings.ts @@ -67,6 +67,9 @@ const settings: TranslationStrings = { 'settings.mapHighQualityHint': 'Antialiasing + globeprojectie voor scherpere randen en een realistische wereldweergave.', 'settings.mapHighQualityWarning': 'Kan de prestaties op minder krachtige apparaten beïnvloeden.', + 'settings.mapHidePois': 'Interessante plekken verbergen', + 'settings.mapHidePoisHint': + 'Verbergt de winkels, restaurants en bezienswaardigheden die Mapbox zelf toont, zodat alleen jouw plekken opvallen. Alleen bij de Standard-stijlen.', 'settings.mapTipLabel': 'Tip:', // same-as-en 'settings.mapTip': 'Rechts-klik en sleep om de kaart te roteren/kantelen. Middenklik om een locatie toe te voegen (rechts-klik is voor rotatie).', diff --git a/shared/src/i18n/pl/settings.ts b/shared/src/i18n/pl/settings.ts index d5d443477..fd08bb455 100644 --- a/shared/src/i18n/pl/settings.ts +++ b/shared/src/i18n/pl/settings.ts @@ -66,6 +66,9 @@ const settings: TranslationStrings = { 'settings.mapHighQualityHint': 'Antialiasing + projekcja globusa dla ostrzejszych krawędzi i realistycznego widoku świata.', 'settings.mapHighQualityWarning': 'Może wpływać na wydajność na słabszych urządzeniach.', + 'settings.mapHidePois': 'Ukryj ciekawe miejsca', + 'settings.mapHidePoisHint': + 'Ukrywa sklepy, restauracje i atrakcje, które Mapbox oznacza sam, by wyróżniały się tylko twoje miejsca. Tylko w stylach Standard.', 'settings.mapTipLabel': 'Wskazówka:', 'settings.mapTip': 'Kliknij prawym przyciskiem i przeciągnij, aby obrócić/pochylić mapę. Środkowy przycisk dodaje miejsce (prawy jest zarezerwowany dla obrotu).', diff --git a/shared/src/i18n/ru/settings.ts b/shared/src/i18n/ru/settings.ts index da71b7828..226296e09 100644 --- a/shared/src/i18n/ru/settings.ts +++ b/shared/src/i18n/ru/settings.ts @@ -66,6 +66,9 @@ const settings: TranslationStrings = { 'settings.mapHighQuality': 'Режим высокого качества', 'settings.mapHighQualityHint': 'Сглаживание + проекция глобуса для более чётких краёв и реалистичного вида мира.', 'settings.mapHighQualityWarning': 'Может повлиять на производительность на слабых устройствах.', + 'settings.mapHidePois': 'Скрыть точки интереса', + 'settings.mapHidePoisHint': + 'Скрывает магазины, рестораны и достопримечательности, которые Mapbox отмечает сам, чтобы выделялись только твои места. Только для стилей Standard.', 'settings.mapTipLabel': 'Совет:', 'settings.mapTip': 'Зажмите правую кнопку мыши и перетащите, чтобы повернуть/наклонить карту. Клик средней кнопкой — добавить место (правая кнопка зарезервирована для вращения).', diff --git a/shared/src/i18n/sk/settings.ts b/shared/src/i18n/sk/settings.ts index 8d6071e8a..60db81974 100644 --- a/shared/src/i18n/sk/settings.ts +++ b/shared/src/i18n/sk/settings.ts @@ -74,6 +74,9 @@ const settings: TranslationStrings = { 'settings.mapHighQuality': 'Režim vysokej kvality', 'settings.mapHighQualityHint': 'Antialiasing + zobrazenie glóbusu pre ostrejšie hrany a realistický pohľad na svet.', 'settings.mapHighQualityWarning': 'Môže ovplyvniť výkon na slabších zariadeniach.', + 'settings.mapHidePois': 'Skryť body záujmu', + 'settings.mapHidePoisHint': + 'Skryje obchody, reštaurácie a pamiatky, ktoré Mapbox označuje sám, aby vynikli len tvoje miesta. Len pre štýly Standard.', 'settings.mapTipLabel': 'Tip:', // same-as-en 'settings.mapTip': 'kliknite pravým tlačidlom a ťahajte pre rotáciu/náklon mapy. Stredné tlačidlo pridá miesto (pravé tlačidlo je vyhradené pre rotáciu).', diff --git a/shared/src/i18n/sv/settings.ts b/shared/src/i18n/sv/settings.ts index 5a2a85009..c6bbd930a 100644 --- a/shared/src/i18n/sv/settings.ts +++ b/shared/src/i18n/sv/settings.ts @@ -67,6 +67,9 @@ const settings: TranslationStrings = { 'settings.mapHighQuality': 'Högkvalitetsläge', 'settings.mapHighQualityHint': 'Antialiasing + globprojektion för skarpare kanter och en realistisk världsbild.', 'settings.mapHighQualityWarning': 'Kan påverka prestandan på enheter i lägre enheter.', + 'settings.mapHidePois': 'Dölj intressepunkter', + 'settings.mapHidePoisHint': + 'Döljer butiker, restauranger och sevärdheter som Mapbox märker ut på egen hand, så att bara dina platser syns. Bara för Standard-stilarna.', 'settings.mapTipLabel': 'Tips:', 'settings.mapTip': 'högerklicka och dra för att rotera eller luta kartan. Mittklicka för att lägga till en plats (högerklick är reserverat för rotation).', diff --git a/shared/src/i18n/th/settings.ts b/shared/src/i18n/th/settings.ts index 97a01b6f6..bb8e516fc 100644 --- a/shared/src/i18n/th/settings.ts +++ b/shared/src/i18n/th/settings.ts @@ -62,6 +62,9 @@ const settings: TranslationStrings = { 'settings.mapHighQuality': 'โหมดคุณภาพสูง', 'settings.mapHighQualityHint': 'การลดรอยหยัก + การฉายภาพลูกโลกเพื่อขอบที่คมชัดยิ่งขึ้นและมุมมองโลกที่สมจริง', 'settings.mapHighQualityWarning': 'อาจส่งผลกระทบต่อประสิทธิภาพการทำงานของอุปกรณ์ระดับล่าง', + 'settings.mapHidePois': 'ซ่อนจุดที่น่าสนใจ', + 'settings.mapHidePoisHint': + 'ซ่อนร้านค้า ร้านอาหาร และสถานที่ท่องเที่ยวที่ Mapbox แสดงเอง เพื่อให้เห็นเฉพาะสถานที่ของคุณ ใช้ได้กับสไตล์ Standard เท่านั้น', 'settings.mapTipLabel': 'เคล็ดลับ:', 'settings.mapTip': 'คลิกขวาค้างแล้วลากเพื่อหมุนหรือเอียงแผนที่ คลิกกลางเพื่อเพิ่มสถานที่ (คลิกขวาสงวนไว้สำหรับการหมุน)', diff --git a/shared/src/i18n/tr/settings.ts b/shared/src/i18n/tr/settings.ts index b2375df27..98c8581f0 100644 --- a/shared/src/i18n/tr/settings.ts +++ b/shared/src/i18n/tr/settings.ts @@ -67,6 +67,9 @@ const settings: TranslationStrings = { 'settings.mapHighQuality': 'Yüksek Kalite Modu', 'settings.mapHighQualityHint': 'Keskin kenarlar ve gerçekçi dünya görünümü için antialiasing + küre projeksiyonu.', 'settings.mapHighQualityWarning': 'Düşük donanımlı cihazlarda performansı etkileyebilir.', + 'settings.mapHidePois': 'İlgi noktalarını gizle', + 'settings.mapHidePoisHint': + 'Mapbox’ın kendi işaretlediği mağaza, restoran ve gezilecek yerleri gizler, böylece yalnızca senin yerlerin öne çıkar. Yalnızca Standard stillerinde.', 'settings.mapTipLabel': 'İpucu:', 'settings.mapTip': 'Haritayı döndürmek/eğmek için sağ tıklayıp sürükleyin. Yer eklemek için orta tıklama (sağ tık döndürmeye ayrılmıştır).', diff --git a/shared/src/i18n/uk/settings.ts b/shared/src/i18n/uk/settings.ts index 0a4ac7635..a5acdc113 100644 --- a/shared/src/i18n/uk/settings.ts +++ b/shared/src/i18n/uk/settings.ts @@ -68,6 +68,9 @@ const settings: TranslationStrings = { 'settings.mapHighQualityHint': 'Згладжування + проекція глобуса для більш чітких країв та реалістичного вигляду світу.', 'settings.mapHighQualityWarning': 'Може вплинути на продуктивність на слабких пристроях.', + 'settings.mapHidePois': 'Сховати цікаві місця', + 'settings.mapHidePoisHint': + 'Ховає магазини, ресторани й пам’ятки, які Mapbox позначає сам, щоб виділялися лише твої місця. Лише для стилів Standard.', 'settings.mapTipLabel': 'Порада:', 'settings.mapTip': 'Затисніть праву кнопку миші та перетягніть, щоб повернути/нахилити карту. Клік середньою кнопкою — додати місце (права кнопка зарезервована для обертання).', diff --git a/shared/src/i18n/vi/settings.ts b/shared/src/i18n/vi/settings.ts index 72c81c9d0..7eaf84a47 100644 --- a/shared/src/i18n/vi/settings.ts +++ b/shared/src/i18n/vi/settings.ts @@ -68,6 +68,9 @@ const settings: TranslationStrings = { 'settings.mapHighQualityHint': 'Khử răng cưa + chiếu hình ảnh địa cầu cho các cạnh sắc nét hơn và thế giới quan chân thực hơn.', 'settings.mapHighQualityWarning': 'Có thể ảnh hưởng đến hiệu suất trên các thiết bị cấp thấp hơn.', + 'settings.mapHidePois': 'Ẩn điểm tham quan', + 'settings.mapHidePoisHint': + 'Ẩn các cửa hàng, nhà hàng và điểm tham quan mà Mapbox tự gắn nhãn, để chỉ địa điểm của bạn nổi bật. Chỉ với các kiểu Standard.', 'settings.mapTipLabel': 'Mẹo:', 'settings.mapTip': 'nhấp chuột phải và kéo để xoay/cao độ bản đồ. Nhấp chuột giữa để thêm địa điểm (nhấp chuột phải được dành riêng cho việc xoay).', diff --git a/shared/src/i18n/zh-TW/settings.ts b/shared/src/i18n/zh-TW/settings.ts index 3843b16fb..1156d4fdc 100644 --- a/shared/src/i18n/zh-TW/settings.ts +++ b/shared/src/i18n/zh-TW/settings.ts @@ -65,6 +65,8 @@ const settings: TranslationStrings = { 'settings.mapHighQuality': '高畫質模式', 'settings.mapHighQualityHint': '抗鋸齒 + 地球投影,帶來更清晰的邊緣和更真實的世界視圖。', 'settings.mapHighQualityWarning': '可能影響低階裝置的效能。', + 'settings.mapHidePois': '隱藏興趣點', + 'settings.mapHidePoisHint': '隱藏 Mapbox 自帶標示的商店、餐廳和景點,只突顯你的地點。僅適用於 Standard 樣式。', 'settings.mapTipLabel': '提示:', 'settings.mapTip': '右鍵點擊並拖曳以旋轉/傾斜地圖。中鍵點擊新增地點(右鍵用於旋轉)。', 'settings.saveMap': '儲存地圖', diff --git a/shared/src/i18n/zh/settings.ts b/shared/src/i18n/zh/settings.ts index 308a1460b..4f36bcb88 100644 --- a/shared/src/i18n/zh/settings.ts +++ b/shared/src/i18n/zh/settings.ts @@ -65,6 +65,8 @@ const settings: TranslationStrings = { 'settings.mapHighQuality': '高画质模式', 'settings.mapHighQualityHint': '抗锯齿 + 地球投影,带来更清晰的边缘和更真实的世界视图。', 'settings.mapHighQualityWarning': '可能影响低端设备的性能。', + 'settings.mapHidePois': '隐藏兴趣点', + 'settings.mapHidePoisHint': '隐藏 Mapbox 自带标注的商店、餐厅和景点,只突出你的地点。仅适用于 Standard 样式。', 'settings.mapTipLabel': '提示:', 'settings.mapTip': '右键点击并拖动以旋转/倾斜地图。中键点击添加地点(右键用于旋转)。', 'settings.saveMap': '保存地图', diff --git a/wiki/Map-Settings.md b/wiki/Map-Settings.md index e3bedfaab..da0207469 100644 --- a/wiki/Map-Settings.md +++ b/wiki/Map-Settings.md @@ -133,6 +133,10 @@ Enables pitch and 3D buildings on all styles. `Mapbox Standard` and `Standard Sa Enables antialiasing and globe projection for sharper edges. May impact performance on lower-end devices. +### Hide Points of Interest + +`Mapbox Standard` and `Standard Satellite` label shops, restaurants and sights of their own. They look like your places but are part of the basemap: they cannot be clicked, and they sit a little off the same place added from the search. With this on, the trip map and the preview leave them out, so only your places stand out. It is off by default, applies to the Standard styles only (the other styles have no such switch), and takes effect without reloading the map. + ## MapLibre GL — style MapLibre GL renders OpenFreeMap vector tiles and needs **no token at all**, so there is no token field on this provider — just a style. @@ -147,7 +151,7 @@ MapLibre GL renders OpenFreeMap vector tiles and needs **no token at all**, so t You can also type any `https://tiles.openfreemap.org/…` style URL. A style that is not an OpenFreeMap URL is rejected and replaced with Liberty when you save. -The **3D Buildings & Terrain** and **High Quality Mode** toggles are Mapbox-only and are not shown for MapLibre GL. +The **3D Buildings & Terrain**, **High Quality Mode** and **Hide Points of Interest** toggles are Mapbox-only and are not shown for MapLibre GL. ## Where a map opens diff --git a/wiki/User-Settings.md b/wiki/User-Settings.md index e02b40065..610b3d3e3 100644 --- a/wiki/User-Settings.md +++ b/wiki/User-Settings.md @@ -75,6 +75,7 @@ The Map tab requires an explicit **Save** action after making changes. - **Mapbox GL** (Experimental): Vector tiles with 3D buildings and terrain. Requires a public Mapbox access token (`pk.*`). Supports built-in style presets (Mapbox Standard, Standard Satellite, Streets, Outdoors, Light, Dark, Satellite, Satellite Streets, Navigation Day, Navigation Night) or a custom `mapbox://styles/USER/ID` URL. Additional options: - **3D Buildings & Terrain**: Pitch and real 3D building extrusions (works on every style including satellite). - **High Quality Mode** (Experimental): Antialiasing + globe projection for sharper edges. May impact performance on lower-end devices. + - **Hide Points of Interest**: Leaves out the shops, restaurants and sights the Mapbox Standard styles label on their own, so only your places stand out. Off by default. - **MapLibre GL**: Vector tiles from **OpenFreeMap**, and the reason to pick it over Mapbox GL: **it needs no access token**. Styles are OpenFreeMap Liberty, Bright, and Positron, or any `https://tiles.openfreemap.org/…` style URL. The 3D and high-quality toggles are Mapbox-only and are not shown here. Each GL provider keeps its own saved style, so switching between Mapbox GL and MapLibre GL never overwrites the other one's choice.