CartoDB needs api key

18 views
Skip to first unread message
Assigned to tobia....@geosolutionsgroup.com by lorenzo...@geosolutionsgroup.com

gaetan....@gmail.com

unread,
Sep 8, 2026, 9:30:20 AMSep 8
to mapstore-developers

Hi,

Following the recent changes to CARTO basemap usage (see https://carto.com/basemaps/apikey/), an API key is now required with ?key=xxxx param.

The MapStore documentation does not seem to explain how this API key should be configured :

https://docs.mapstore.geosolutionsgroup.com/en/latest/developer-guide/maps-configuration/#map-configuration

MapStore can use CARTO basemaps through the tile provider mechanism:

https://github.com/geosolutions-it/MapStore2/blob/5e0ea6dd6c2b7389f8b0a8bfa7dba498319a58bf/web/client/utils/ConfigProvider.js#L523

However, I have not been able to make the API key work when configuring the layer in new.json > layers.

I tried the following configurations:

  1. Using an apiKey property and a placeholder in the URL:
{ "url": "https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}.png/?key={apiKey}", "apiKey": "xxxxxxxxxxxxxxxxx", "provider": "CartoDB.Positron" }

This does not work.

  1. Adding the API key directly to the URL:
{ "url": "https://{s}.basemaps.cartocdn.com/{variant}/{z}/{x}/{y}.png/?key=xxxxxxxxxxx", "provider": "CartoDB.Positron" }

This does not work either.

Is there currently a supported way to provide a CARTO API key when using a tileprovider layer such as CartoDB.Positron ?

If not, would support for passing the API key to the underlying tile provider need to be added to MapStore ?

Thanks.

Gaetan

gaetan....@gmail.com

unread,
Sep 8, 2026, 9:45:34 AMSep 8
to mapstore-developers
This works with a custom provider : 

{
  "type": "tileprovider",
  "title": "CartoDB Positron",
  "provider": "custom",
  "name": "CartoDB.Positron",
  "group": "background",
  "visibility": true,
  "url": "https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png?key=xxxxxxxxxxxxxx",
  "options": {
    "subdomains": ["a", "b", "c", "d"]
  },
  "thumbURL": "https://preprod-sig.sesan.fr/logo/thumbnail/CartoDB.Positron.jpg"
},


I’m not sure whether the default CartoDB provider is still usable.

Tobia Di Pisa

unread,
Sep 8, 2026, 10:54:35 AMSep 8
to mapstore-...@googlegroups.com
Dear Gaetan,

This works with a custom provider 

That's the correct one, I confirm.

I’m not sure whether the default CartoDB provider is still usable.

We will double check the list. Thanks.

Regards,
     Tobia Di Pisa

--
You received this message because you are subscribed to the Google Groups "mapstore-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-develo...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/mapstore-developers/04fcc619-b22b-4c0f-9cc1-80e82d7bcdd7n%40googlegroups.com.


--


==
GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.
==
Dott. Ing. Tobia Di Pisa
Technical Lead / Project Manager


GeoSolutions Group
phone: +39 0584 962313

mobile: +39 340 1781783
fax:      +39 0584 1660272

https://www.geosolutionsgroup.com/
http://twitter.com/geosolutions_it
-------------------------------------------------------


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Reply all
Reply to author
Forward
0 new messages