I haven’t used Cesium for 2 or 3 years now and I’m trying to get things back up and running. I’m having trouble connecting to the ArcGIS Map Server. I’m getting the starry background but the Earth image not showing at startup.
Wondering if some fundamental elements have changed?
My current code that worked in the past . . .
var viewer = new Cesium.Viewer(‘cesiumContainer’,
{
requestRenderMode : true,
maximumRenderTimeChange : Infinity,
showTimeOptions:false,
targetFrameRate: 30,
imageryProvider: new Cesium.ArcGisMapServerImageryProvider({
url: “World_Street_Map (MapServer)”}),
terrainProvider: new Cesium.VRTheWorldTerrainProvider({
url: “http://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/” }),
baseLayerPicker:false,
animation: false
}
);
The url above is \https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer
. . . without the leading backslash
Are you providing an API key? Arcgis usually requires you setup the default access token like so:
ArcGisMapService.defaultAccessToken = arcGisApiKey;
That must be something new in the past couple years. I haven’t heard of having to do that before. It had always been sort of an open access database source.
I see from the sandcastle page that the calls to the database have changed and now need a token.
Edit:
I tried running the following code from the example in the sandcastle but did not work . . .
const viewer = new Cesium.Viewer(“cesiumContainer”, {
baseLayer: Cesium.ImageryLayer.fromProviderAsync(
Cesium.ArcGisMapServerImageryProvider.fromBasemapType(
Cesium.ArcGisBaseMapType.SATELLITE, {
token: “”
})),
});
Ok, so after registering for my token/API Key, I tried several different combinations but didn’t get things to work until I went back to my old code and removed the terrain provider url. I ended up not even using the API Key. Now things are working and I’m able to see my World Street Map View.
I guess now the question is, what did the terrain url change to?
Cesium.VRTheWorldTerrainProvider({ url: “???” })