OSM listed hillshading tile server

Hello

Whilst I’m able to add an imagery layer like this:

var layers = viewer.scene.imageryLayers;
var hillShader = layers.addImageryProvider(new Cesium.createOpenStreetMapImageryProvider({
url : ‘http://tile.stamen.com/terrain-background/’,

``

I’m not getting anything with this server:

var layers = viewer.scene.imageryLayers;
var hillShader = layers.addImageryProvider(new Cesium.createOpenStreetMapImageryProvider({
url : ‘http://a.tiles.wmflabs.org/hillshading/’,

``

yet it is possible to pull a png from that server when given an absolute:

http://a.tiles.wmflabs.org/hillshading/12/2208/1373.png

So is there something amiss at my end, cesiumjs or the server ?

If there is no solution to be had with this tile server, can anyone recommend an alternative hillshader tile set that has an alpha channel suitable for overlays ?

Thanks

Tim

Hello,

It looks like the server with the hillshading does not have CORS (cross-origin resource sharing) enabled. This is preventing Cesium from retrieving the tiles since it is hosted on a different server.

If you have control of the server, you can learn about how to enable CORS here: http://enable-cors.org/index.html

Best,

Hannah

Hi Hannah

Thank you for taking a look at this issue.

It’s not my server. It’s listed on the OSM Tile Server page http://wiki.openstreetmap.org/wiki/Tile_servers , so I assumed, incorrectly perhaps, that it would probably adhere to the same standards as the other OSM listed tile servers.

Since I don’t have control over the server, what would be my next best course of action to take ?

Thanks

Tim :slight_smile:

Hi Tim,

You could try to contact them to see if they can enable CORS support. There’s really no workaround because CORS is enabled by default to restrict access for security purposes. They should be able to enable it just for the tile server.

-Hannah