Add LocationIQ as supported map provider (#1293)

- Add LocationIQ access token field to settings and export modals
  - Include LocationIQ Streets style in gallery
  - Support automatic token replacement for LocationIQ URLs
  - Add LocationIQ tileset configuration
  - Include translations for all supported languages

## Launch Checklist
 - [x] Briefly describe the changes in this PR.
 - [x] Write tests for all new functionality.
 - [x] Add an entry to `CHANGELOG.md` under the `## main` section.
This commit is contained in:
Gopi Aravind
2025-08-17 13:36:26 +05:30
committed by GitHub
parent 728de3aed6
commit e2e29d7f5e
16 changed files with 69 additions and 1 deletions

View File

@@ -20,6 +20,12 @@ const spec = (t: TFunction) => ({
docUrl: "https://docs.stadiamaps.com/authentication/",
docUrlLinkText: t("Learn More")
},
locationiq_access_token: {
label: t("LocationIQ Access Token"),
doc: t("Public access token for LocationIQ services."),
docUrl: "https://docs.locationiq.com/docs/maps",
docUrlLinkText: t("Learn More")
},
style_renderer: {
label: t("Style Renderer"),
doc: t("Choose the default Maputnik renderer for this style.")

View File

@@ -79,6 +79,9 @@ function replaceSourceAccessToken(mapStyle: StyleSpecification, sourceName: stri
// so we need to check the source URL.
authSourceName = "stadia"
}
else if (("url" in source) && source.url?.match(/\.locationiq\.com/)) {
authSourceName = "locationiq"
}
const accessToken = getAccessToken(authSourceName, mapStyle, opts)
@@ -138,6 +141,7 @@ function stripAccessTokens(mapStyle: StyleSpecification) {
delete changedMetadata['maputnik:openmaptiles_access_token'];
delete changedMetadata['maputnik:thunderforest_access_token'];
delete changedMetadata['maputnik:stadia_access_token'];
delete changedMetadata['maputnik:locationiq_access_token'];
return {
...mapStyle,
metadata: changedMetadata