CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
13.03k stars 3.51k forks source link

Carto basemap link not working in our doc examples for `UrlTemplateImageryProvider` #12272

Closed lukemckinstry closed 3 weeks ago

lukemckinstry commented 4 weeks ago

What happened?

In our docs for UrlTemplateImageryProvider, the basemap service from Carto is not loading imagery on the globe. It appears the service is still active https://github.com/CartoDB/basemap-styles.

The following code does not load tiles in sandcastle

const viewer = new Cesium.Viewer('cesiumContainer', {
    imageryProvider: new Cesium.UrlTemplateImageryProvider({
        url: 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
        subdomains: 'abcd', // Carto supports these subdomains
        credit: '© CartoDB'
    }),
    baseLayerPicker: false // Disable default base layers if you only want the Carto basemap
});

Reproduction steps

1. 2. 3. ...

Sandcastle example

No response

Environment

Browser: CesiumJS Version: Operating System:

ggetz commented 3 weeks ago

@lukemckinstry The imageryProvider option was deprecated and ultimately removed in version 1.107. Use baseLayer instead:

const viewer = new Cesium.Viewer('cesiumContainer', {
     baseLayer: new Cesium.ImageryLayer(new Cesium.UrlTemplateImageryProvider({
        url: 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
        subdomains: 'abcd', // Carto supports these subdomains
        credit: '© CartoDB'
    })),
    baseLayerPicker: false // Disable default base layers if you only want the Carto basemap
});