1. A concise explanation of the problem you're experiencing.
I would like to load WMTS imagery from a server that requires authentication (a bearer token). Each tile request requires the token in the request header. The WebMapTileServiceImageryProvider API does not appear to expose such a token or the request headers. Therefore, I am not able to request WMTS imagery from my server using WebMapTileServiceImageryProvider.
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
This is an example of how I would like to use the API:
var wmtsImagery = new Cesium.WebMapTileServiceImageryProvider({
url : ‘https://example.com/wmts/’,
token : ‘theBearerToken’,// pass in the token here
});
viewer.imageryLayers.addImageryProvider(wmtsImagery);
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
Should I create my own imagery provider using the ImageryProvider interface as described here https://cesiumjs.org/tutorials/Imagery-Layers-Tutorial/#imagery-providers? This provider would essentially be exactly the same as the WebMapTileServiceImageryProvider, only it would allow an optional token to be part of each request. Or perhaps I should submit a pull request. I have not fully investigated how difficult this implementation would be.
4. The Cesium version you're using, your operating system and browser.
Cesium: 1.39.0
OS: Ubuntu 16.04
Browser: Chrome 62.0.3202.94 64-bit
Thank you,
Eric