mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-20 05:56:53 +00:00
fix(admin): the default map template offers the Amap presets users can pick
In the admin's default user settings, the map template dropdown listed
seven tile presets, while every user's own map settings listed nine: the
same seven plus Amap and Amap Satellite. An admin running an instance for
people in mainland China could not pick the one basemap that works well
there as the default, short of pasting its URL by hand.
The Amap presets (57eac32f9) were added to the two user preset copies and
not to the admin's separate copy; nothing in that change or later gives a
reason, and the server stores any template as a default. The later
refactor kept the gap as DEFAULT_MAP_PRESETS beside MAP_PRESETS. There is
now one MAP_PRESETS list, read by the user settings and the admin defaults
on both desktop and phone.
Regression test FE-ADMIN-DUS-029 (DefaultUserSettingsTab.test.tsx) was red
on the old code: "Unable to find role="button" and name "高德地图 (Amap)"".
Changed assertions:
- useMapSettingsForm.test.ts FE-COMP-MAPFORM-001: it expected the admin list
DEFAULT_MAP_PRESETS to hold 7 presets and the user list to add Amap on
top; it now expects the one list to hold 9 presets including both Amap
templates.
This commit is contained in:
@@ -18,8 +18,11 @@ export interface MapPreset {
|
||||
url: string;
|
||||
}
|
||||
|
||||
/** The tile presets an admin can make the default for every user. */
|
||||
export const DEFAULT_MAP_PRESETS: MapPreset[] = [
|
||||
/**
|
||||
* The tile presets a user picks from in their own map settings, and the same list
|
||||
* an admin picks the default for every user from.
|
||||
*/
|
||||
export const MAP_PRESETS: MapPreset[] = [
|
||||
{ name: 'OpenStreetMap', url: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png' },
|
||||
{ name: 'OpenStreetMap DE', url: 'https://tile.openstreetmap.de/{z}/{x}/{y}.png' },
|
||||
// The app default, and a vector style rather than a {z}/{x}/{y} template: no
|
||||
@@ -31,11 +34,6 @@ export const DEFAULT_MAP_PRESETS: MapPreset[] = [
|
||||
{ name: 'CartoDB Light', url: 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png' },
|
||||
{ name: 'CartoDB Dark', url: 'https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png' },
|
||||
{ name: 'Stadia Smooth', url: 'https://tiles.stadiamaps.com/tiles/alidade_smooth/{z}/{x}/{y}{r}.png' },
|
||||
];
|
||||
|
||||
/** The tile presets a user picks from in their own map settings. */
|
||||
export const MAP_PRESETS: MapPreset[] = [
|
||||
...DEFAULT_MAP_PRESETS,
|
||||
// Amap (高德). GCJ-02 tiles: the map switches to a shifted projection for
|
||||
// these so markers still land on the right street (see gcj02Crs.ts). The only
|
||||
// basemap here that is genuinely good inside mainland China.
|
||||
|
||||
Reference in New Issue
Block a user