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.04k stars 3.51k forks source link

[UrlTemplateImageryProvider] When subdomains are placed within the port number, the imagery provider fails to load properly. #11354

Closed zouyaoji closed 1 year ago

zouyaoji commented 1 year ago

Sandcastle example:


Browser:


Operating System:

UrlTemplateImageryProvider, when my subdomains are in the port number, throws an error like the following: http://192.168.2.114:570{s}/tiles/arcgis_black/{z}/{x}/{reverseY}.png

Uncaught (in promise) TypeError: Port "570{s}" is not a valid port.

image

IKangXu commented 1 year ago

I think you should do this. http://192.168.2.114{s}/tiles/arcgis_black/{z}/{x}/{reverseY}.png

ggetz commented 1 year ago

@zouyaoji Subdomains are a different part of the URL.

Here's an example of how they work with UrlTemplateImageryProvider

// Access the CartoDB Positron basemap, which uses an OpenStreetMap-like tiling scheme.
const positron = new Cesium.UrlTemplateImageryProvider({
    url : 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
    credit : 'Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.'
});