The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.
TypeScript budget-trackercollaborativedockeritinerarymcp-serveroffline-firstopen-sourceopenstreetmappacking-listpwareal-timeself-hostedselfhostedtraveltravel-apptravel-journaltravel-plannertripitwanderlog
docs(maps): Amap beside the TREK index
Maurice3e8ab22836ee
diff --git a/wiki/Environment-Variables.md b/wiki/Environment-Variables.mdindex 1c7c0be8f..8cf2a5757 100644--- a/wiki/Environment-Variables.md+++ b/wiki/Environment-Variables.md@@ -316,38 +316,40 @@ To get a key: create a free account at [unsplash.com/developers](https://unsplas## Place Search (Amap / 高德地图)-Google Places is unreachable from most networks inside mainland China, and OpenStreetMap's coverage of Chinese POIs —-restaurants, shops, the things a trip is actually made of — is thin and rarely in Chinese. TREK can use-[Amap (高德地图)](https://lbs.amap.com/) instead, as a first-class place provider: search, autocomplete, place details-and reverse geocoding all go through it, and there is an Amap basemap to match (see [[Map Settings|Map-Settings]]).+Google Places is unreachable from most networks inside mainland China, and OpenStreetMap's coverage of Chinese POIs+(restaurants, shops, the things a trip is actually made of) is thin and rarely in Chinese. TREK can put+[Amap (高德地图)](https://lbs.amap.com/) in the slot Google otherwise holds: the TREK Places index and OpenStreetMap+still answer first, Amap answers when they have nothing, and autocomplete, place details and reverse geocoding go+through it. There is an Amap basemap to match (see [[Map Settings|Map-Settings]]).| Variable | Description | Default ||-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|| `AMAP_API_KEY` | Amap **Web 服务** (web service) key. When set, it takes priority over any key configured in **Admin → Settings → API Keys**, exactly like `PLACES_API_KEY` does for Google. | unset |-| `AMAP_API_SECRET` | The private secret (数字签名) of that key. **Required if — and only if** the key was created with signing enabled: such a key rejects every unsigned request. Leave unset otherwise. | unset |-| `AMAP_API_BASE` | Send the calls somewhere other than `https://restapi.amap.com` — an egress proxy, a cache, a gateway that holds the credential. The replacement has to speak the same API. Mirrors `PLACES_API_BASE`. | `https://restapi.amap.com` |+| `AMAP_API_SECRET` | The private secret (数字签名) of that key. Required exactly when the key was created with signing enabled: such a key rejects every unsigned request. Leave unset otherwise. | unset |+| `AMAP_API_BASE` | Send the calls somewhere other than `https://restapi.amap.com`: an egress proxy, a cache, a gateway that holds the credential. The replacement has to speak the same API. Mirrors `PLACES_API_BASE`. | `https://restapi.amap.com` |**Get a key** at [console.amap.com](https://console.amap.com/dev/key/app): create an application, then add a key oftype **Web 服务**. A **Web 端 (JS API)** key is a different kind of credential and will be rejected with-`INVALID_USER_KEY` — this is the single most common misconfiguration.+`INVALID_USER_KEY`. This is the single most common misconfiguration.-**Two ways to configure it** — pick one; the env var wins if both are present:+**Two ways to configure it**, pick one; the env var wins if both are present:-1. **Environment variable** (this page) — instance-wide, ideal for Docker/Helm where you already manage config as env.-2. **Admin → Settings → API Keys** — paste it into the **高德地图 API Key** field. Stored encrypted at rest.+1. **Environment variable** (this page): instance-wide, ideal for Docker/Helm where you already manage config as env.+2. **Admin → Settings → API Keys**: paste it into the **Amap (高德地图) API Key** field. Stored encrypted at rest.-Setting a key is not enough on its own: **Admin → Settings → API Keys → Place search provider** decides which provider-answers. `Automatic`, the default, keeps Google when a Google key is configured, then falls back to Amap, then to-OpenStreetMap — so adding an Amap key never silently moves an existing install off Google. Choose **Amap** explicitly-to make it the provider.+Setting a key is not enough on its own: **Admin → Settings → API Keys → Place search provider** decides which keyed+provider answers. `Automatic`, the default, keeps Google when a Google key is configured, then takes Amap, then+nobody, so adding an Amap key never silently moves an existing install off Google. Choose **Amap** explicitly to make+it the provider. The choice is available on managed instances too, where the keys themselves come from the operator.### CoordinatesAmap speaks **GCJ-02**, the offset datum Chinese law requires published maps to use; everything TREK stores is**WGS-84**. The conversion happens at the boundary, in both directions, so what lands in the database, in a GPX export-or on a map is always WGS-84 — a place added through Amap and opened in OpenStreetMap later is in the right spot. You-do not need to configure anything for this, but it is worth knowing if you compare raw coordinates against Amap's own-website, which will differ by a few hundred metres.+or on a map is always WGS-84: a place added through Amap and opened in OpenStreetMap later is in the right spot. The+place also keeps the Amap id it was found by, so it keeps opening against Amap whichever provider is selected later.+You do not need to configure anything for this, but it is worth knowing if you compare raw coordinates against Amap's+own website, which will differ by a few hundred metres.---diff --git a/wiki/Map-Settings.md b/wiki/Map-Settings.mdindex b05d69915..5eb334e88 100644--- a/wiki/Map-Settings.md+++ b/wiki/Map-Settings.md@@ -66,18 +66,19 @@ never stored inside the tile URL itself, so switching keys later does not breakOther providers are unaffected, and a keyless CARTO template is treated as "not configured" so the map falls back toOpenFreeMap instead of drawing watermarked tiles. Save a key and your template is kept as you entered it.-Offline pre-download works on OpenFreeMap and on CARTO. It does not work on the OpenStreetMap presets, whose tile-servers do not permit bulk downloading.+Offline pre-download works on OpenFreeMap, on CARTO and on the Amap presets. It does not work on the OpenStreetMap+presets, whose tile servers do not permit bulk downloading.## Amap (高德地图) basemap-Two presets — **高德地图 (Amap)** for the road map and **高德卫星 (Amap Satellite)** for imagery. They need no key and+Two presets: **高德地图 (Amap)** for the road map and **高德卫星 (Amap Satellite)** for imagery. They need no key andno account, and inside mainland China they are far better than anything else in the list: OpenStreetMap andOpenFreeMap are sparse there, and the foreign tile CDNs are slow or unreachable.These tiles are drawn in **GCJ-02**, an offset datum, while every coordinate in TREK is WGS-84. TREK handles that foryou: a map on an Amap basemap switches to a shifted projection, so markers, routes, clusters and the coordinates you-get from clicking the map all stay where they belong. Nothing is stored differently — only the drawing changes.+get from clicking the map all stay where they belong, on the planner map and on the journey map alike. Nothing is+stored differently, only the drawing changes.Two consequences worth knowing:@@ -86,7 +87,7 @@ Two consequences worth knowing:- Amap has **no coverage outside China**. A trip to Lisbon on an Amap basemap gets a nearly empty map, so this is achoice for instances whose trips are mostly domestic.-For place *search* via Amap — a separate setting from the basemap — see+Place *search* via Amap is a separate setting from the basemap, see[[Places and Search|Places-and-Search]] and [[Environment Variables|Environment-Variables]].## Mapbox GL — access token and stylediff --git a/wiki/Places-and-Search.md b/wiki/Places-and-Search.mdindex 9842b0c9c..be231a5ab 100644--- a/wiki/Places-and-Search.md+++ b/wiki/Places-and-Search.md@@ -25,38 +25,44 @@ When a key is present, the autocomplete uses the Google Places API, which can re### Without a Google Maps API key-TREK falls back to OpenStreetMap (Nominatim) automatically — no API key needed. A notice appears above the search box — *Using OpenStreetMap…* — and what it suggests follows the **Place search provider** setting: a Google key when the provider is Google, an Amap key when it is Amap, either one when the choice is Automatic and neither key is set. When the provider choice is OpenStreetMap the notice stays quiet: that is a decision, not a gap. Results include name, address, and coordinates.+Search still works, and it needs no key. Two sources answer every search together: the TREK Places index, a dataset of businesses and sights that TREK maintains itself, and OpenStreetMap, which is where the temples, bridges and viewpoints are. Each row in the result list carries a small mark naming where it came from (TREK, OpenStreetMap, Google or Amap), so a list that mixes sources stays readable. Results include name, address and coordinates.++A key does not buy a different search. It fills the slot that answers once the index and OpenStreetMap have nothing, and it adds what only a commercial provider has: ratings, opening hours and, with Google, photos.### With an Amap (高德地图) API key-> **Admin:** Set the key in **Admin → Settings → API Keys → 高德地图 API Key**, then pick **Amap** under **Place search+> **Admin:** Set the key in **Admin → Settings → API Keys → Amap (高德地图) API Key**, then pick **Amap** under **Place search> provider** in the same card. It needs a **Web 服务** (web service) key from-> [console.amap.com](https://console.amap.com/dev/key/app) — a JS API key is a different credential and is rejected.+> [console.amap.com](https://console.amap.com/dev/key/app); a JS API key is a different credential and is rejected.Google Places is unreachable from most networks inside mainland China, and OpenStreetMap knows very little about-Chinese restaurants, shops and shopping centres. With Amap selected, search, autocomplete, place details and the-reverse geocoding behind right-click-to-add-a-place all go through Amap instead, in Chinese, with ratings, phone-numbers and opening hours where Amap has them.+Chinese restaurants, shops and shopping centres. With Amap selected it takes the slot Google otherwise holds: the index+and OpenStreetMap are still asked first, and Amap answers when they have nothing, in Chinese, with ratings, phone+numbers and opening hours where Amap has them. Autocomplete, place details and the reverse geocoding behind+right-click-to-add-a-place go through Amap as well. Rows that came from Amap carry an Amap mark like every other+source.Amap does not supply place photos here. Its images come with no licence statement TREK could show next to them, so an-Amap place gets its picture from Wikimedia Commons like any other — with the credit and licence attached.+Amap place gets its picture from Wikimedia Commons like any other, with the credit and licence attached.-Places remember which provider found them, so switching provider later does not break anything you already saved: an-existing Google place still opens against Google, and vice versa.+A place remembers where it came from. One picked from Amap keeps its Amap id, one picked from Google keeps its Google+id, and each keeps opening against the provider that knows it, whichever provider the admin selects later.-You can also paste an Amap share link — `uri.amap.com/marker?…`, `amap.com/place/…`, or a `surl.amap.com` short link —-into the search box, the same way a Google Maps URL works below.+You can also paste an Amap share link into the search box: `uri.amap.com/marker?…`, `amap.com/place/…` or a+`surl.amap.com` short link, the same way a Google Maps URL works below.### Which provider answers-**Admin → Settings → API Keys → Place search provider**:+**Admin → Settings → API Keys → Place search provider** decides only who fills the keyed slot beside the index and+OpenStreetMap. Those two are asked either way. The choice is available on managed instances too, where the keys+themselves come from the operator.-| Setting | What answers place search |+| Setting | Who fills the keyed slot ||------------------|-------------------------------------------------------------------------------|-| `Automatic` | Google when a Google key is set, otherwise Amap when an Amap key is, otherwise OpenStreetMap. This is the default and preserves what an existing install already did. |-| `Google Places` | Google. With no Google key, search falls back to OpenStreetMap rather than to Amap. |-| `Amap (高德地图)` | Amap. With no Amap key, search falls back to OpenStreetMap. |-| `OpenStreetMap` | Always OpenStreetMap, ignoring both keys. |+| `Automatic` | Google when a Google key is set, otherwise Amap when an Amap key is, otherwise nobody. The default, and what every install had before Amap existed: adding an Amap key never moves an install off Google on its own. |+| `Google Places` | Google. With no Google key the slot stays empty rather than falling to Amap. |+| `Amap (高德地图)` | Amap. With no Amap key the slot stays empty. |+| `OpenStreetMap` | Nobody, whatever keys are configured. Search runs on the index and OpenStreetMap alone. |## Place details while searching