Skip to content

[FEAT] Support CARTO API Keys and Configurable Map Providers #5012

Description

@maxhayim

Is your feature request related to a problem? Please describe.

Yes.

CARTO has started requiring API keys for access to its basemaps. Applications currently using CARTO tiles without authentication may begin displaying API key warnings or eventually lose access to those basemaps.

At the moment, there does not appear to be a way for users or administrators to provide their own CARTO API key.

This also highlights a broader issue: the application is dependent on specific map providers. Map providers can change their API requirements, pricing, rate limits, authentication methods, or availability over time.

Being dependent on a single hard-coded map source makes the mapping functionality vulnerable to those changes.

It can also limit users who may prefer another mapping provider because of:

  • Better map coverage in their region
  • Better satellite imagery
  • Different map styles
  • Existing API subscriptions
  • Self-hosted deployments
  • Privacy requirements
  • Performance
  • Rate limits
  • Offline or locally hosted tile servers

Describe the solution you'd like

I would like the application to support configurable map providers, starting with the ability to provide a CARTO Basemaps API key.

For example:

Map Provider:
CARTO

CARTO API Key:
[________________________]

The application could then automatically append the configured API key to CARTO tile requests.

Example:

https://basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png?key=YOUR_KEY

Multiple Map Providers

Ideally, the map settings should allow users or administrators to select from multiple map providers.

Possible providers could include:

CARTO
OpenStreetMap
Google Maps
Google Satellite
Google Hybrid
Google Terrain
MapTiler
Mapbox
Stadia Maps
Custom XYZ Tile Server
Custom Vector Tile Server

Providers that require authentication could expose an API key or token field when selected.

For example:

Map Provider:
Google Maps

Google Maps API Key:
[________________________]

Or:

Map Provider:
MapTiler

MapTiler API Key:
[________________________]

Google Maps Support

It would be particularly useful to support Google Maps Platform as an optional map provider.

Google Maps could provide options such as:

Roadmap
Satellite
Hybrid
Terrain

This would be especially useful for users who already have a Google Maps Platform API key or prefer Google's satellite imagery and mapping data for viewing nodes, routes, telemetry, coverage, and other geographically displayed information.

The Google Maps API key should be supplied by the user or administrator rather than bundled with the application.

Custom Map Provider

A Custom Map Provider option would also be extremely useful.

Advanced users could enter a compatible XYZ tile URL such as:

https://example.com/tiles/{z}/{x}/{y}.png

Or a provider requiring an API key:

https://example.com/tiles/{z}/{x}/{y}.png?key={api_key}

Possible configuration:

Provider Name:
My Custom Maps

Tile URL:
https://example.com/tiles/{z}/{x}/{y}.png

API Key / Token:
[________________________]

Attribution:
[________________________]

Maximum Zoom:
[____]

If vector tiles are supported by the map library, a similar option could eventually be provided for custom vector tile sources.

Suggested Settings Layout

Maps
────────────────────────────────

Map Provider:
[ CARTO ▼ ]

API Key:
[________________________________]

Map Style:
[ Voyager ▼ ]

────────────────────────────────

Available Providers:

○ CARTO
○ OpenStreetMap
○ Google Maps
○ MapTiler
○ Mapbox
○ Stadia Maps
○ Custom

────────────────────────────────

Custom Provider Settings

Tile URL:
[________________________________]

API Key / Token:
[________________________________]

Attribution:
[________________________________]

Maximum Zoom:
[____]

The available configuration fields could change depending on the selected provider.

Why this would be useful

This would make the map system significantly more flexible and future-proof.

If one mapping provider:

  • Changes its API requirements
  • Introduces API keys
  • Changes its pricing
  • Changes its rate limits
  • Has an outage
  • Discontinues a service
  • Has poor coverage in a particular region

users could simply switch to another provider without requiring changes to the application itself.

It would also allow deployments to use whichever mapping service best fits their particular environment.

For larger or self-hosted deployments, this could be especially useful because they may already have existing accounts or infrastructure for:

  • CARTO
  • Google Maps Platform
  • OpenStreetMap
  • MapTiler
  • Mapbox
  • Stadia Maps
  • Self-hosted tile servers

Describe alternatives you've considered

One alternative would be to replace CARTO entirely with another provider that currently does not require an API key.

However, this would only move the dependency from one provider to another.

The same problem could occur again if that provider later changes its API requirements, rate limits, pricing, or access policies.

Another option would be to hard-code a CARTO or Google Maps API key into the application.

I do not think this would be ideal because it could create issues involving:

  • API usage limits
  • Billing
  • API key security
  • Abuse
  • Shared quotas
  • Provider terms
  • Rate limits

Allowing each installation or user to provide their own API key would keep usage associated with the appropriate account.

For this reason, I think the best long-term solution would be to create a provider abstraction for the mapping system rather than implementing another single hard-coded provider.

Additional context

CARTO API key information:

https://carto.com/basemaps/apikey/

Example CARTO tile request:

https://basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png?key=YOUR_KEY

Google Maps Platform could also be offered as an optional provider using a user-supplied Google Maps API key.

Ideally, the implementation would separate the map interface from the underlying provider so additional providers can be added later without requiring major changes throughout the application.

Conceptually:

Application Map
       │
       ▼
Map Provider Interface
       │
       ├── CARTO
       ├── OpenStreetMap
       ├── Google Maps
       ├── MapTiler
       ├── Mapbox
       ├── Stadia Maps
       └── Custom XYZ / Vector Tiles

This would solve the immediate CARTO API-key issue while also making the mapping system much more flexible going forward.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions