Breaking changes in 1.43, the /Cesium/Widgets/Images/TerrainProviders/STK.png icon is gone

Like a fool, I updated from 1.41 to 1.43 without reading the release notes, and discovered the breaking changes with deprecation of STK terrain.

Supposedly “available until September 1”, but the first breaking change was the /Cesium/Widgets/Images/TerrainProviders/STK.png icon is already gone.

I just love updating working code for enhancements like this. I don’t have anything better to do.

**And 1.42 includes “a built-in key free for non-commercial and commercial use until September 1, 2018”, then I have to create an “ion account”. Progress. Great. T****hanks for the higher resolution “world terrain”. Will my GPS tracks still be underground half the route? I can’t wait to rewrite a few functions, and find out. **

An hour later, I’ve learned that no, my GPS tracks will still be underground half the time because the “World terrain” in the US is not any higher resolution than “STK terrain” (but I’ve always wanted to travel to Australia, New Zealand, and the UK and hike with my GPS).

The code snippet that I needed was missing from all the documentation updates. Maybe this will help some other user:

terrainViewModels.push(new Cesium.ProviderViewModel({

 name : 'Cesium\u00adWorld\u00adTerrain',

 iconUrl : '127.0.0.1:4001/Cesium/Build/Cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png',

 tooltip : 'High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion.\nhttps://cesium.com/content/cesium-world-terrain/',

 creationFunction : function() {

     return Cesium.createWorldTerrain();

}

}));

Hi Left Gully,

There is actually an additional 10m resolution in the US in the new Cesium World Terrain, see the blog post explanation. While it may not be in every area, you’ll see some sites with a drastic difference. (Hopefully you can try hiking and tracking in Australia, New Zealand, and the UK sometime!)

While the STK World Terrain in the Base Layer Picker widget has been removed, the dataset itself is still available to use until September 1 as a terrain provider with the url https://assets.agi.com/stk-terrain/world

I’m confused what you are trying to accomplish with your code snippet, can you provide a little more context? The Cesium World Terrain is available in the base layer picker already, and you should be able to set the terrainProvider like so:

scene.terrainProvider = Cesium.createWorldTerrain();

``

Thanks!
Gabby

Gabby-
My application is a WordPress plugin for embedding Cesium maps in blog posts. It was born out of volunteer work developing a 3D avalanche hazard map that was kicked to the curb by Luddites. I don’t use the off-the-shelf version of Cesium’s base layer picker because, in order to customize it with several regional base layers, I need to set each image and terrain ProviderViewModel and push that to the collection. The image base layers are as small as a few square-mile area tile map service hosted on ArcGIS OnLine of a hiking trail map I prepared for the local Randolph Mountain Club; the state of New Hampshire’s 1-foot resolution aerial photos, hosted on their state GIS agency’s ArcGIS Server; and the latest addition was Austria’s OpenGovernmentData tile map service (I love the Alps in 3D!).

Hey, I’m open to suggestions if there’s a new way to streamline customization of the base layer picker. I wrote that part of my code 3 years ago for Cesium 1.5

I’m not a full-time programmer, this is a labor of love on my nights and weekends, and after finishing last weekend’s bug fixes and enhancements to my code, I said to my wife, “I really ought to roll this month’s Cesium update into this week’s WordPress plugin update. It will probably fix a few bugs, add some features I won’t use, and break something I do use”. I hate being so prophetic. I felt guilty for skipping over Cesium’s February 1.42 update, so I hastily downloaded and packaged 1.43 in my plugin installer without testing it on the localhost. Then I saw the console error regarding the missing STK.png, after updating my GoDaddy development site, when I opened the first page to test my other fixes and enhancements. Sometimes experiences like this make me glad I’m not a full-time programmer, other times I wish I was getting paid for the hours I spend coding. But when I start panning and zooming around in those 3D Cesium maps, the smile comes back to my face.

I understand the struggle. What your doing to customize the Base Layer Picker sounds like it should still work. The only modification you will need to do is update the thumbnails. Since we got rid of STK World Terrain from the Base Layer Picker, we also got rid of STK.png since we didn’t need to show it as an option anymore. Now there’s CesiumWorldTerrain.png for the new Cesium World Terrain. You could use that instead, or get a copy of STK.png from one of our old releases and host it on your site if you still want to use the STK Wolrd Terrain until September 1st.

Thanks,

Gabby

Yes, Gabby, it worked fine. I moved world terrain to the first terrain provider position, index 0, and so now it is the default 3D terrain for all my old WordPress blog posts that referenced STK. The spheroid is index 1. I moved STK terrain to index 2, a 3rd choice, using the old png, although its a moot point. As long as World terrain keeps working, I'll probably take STK out in a few weeks.
This was a good wake-up call, as I hadn't been reading release notes to see what's deprecated. This weekend I replaced .loadXML with .Resource.fetchXml in my GPX-file loading class. Thanks!
-Jon