Hi,
From the following code, we can see that if someone zoom out, the image disappear.
This is because the WMTS server is not serving tiles for these levels.
Would it be possible to configure the layer to use lower level tiles when higher level tiles are not available ?
var widget = new Cesium.CesiumWidget('cesiumContainer');
var landsat = new Cesium.WebMapTileServiceImageryProvider({
url : ‘http://maps.ypeka.gr/arcgis/rest/services/YPEKA/LandSat/MapServer/WMTS’,
layer : 'YPEKA_LandSat ',
style : ‘default’,
format : ‘image/jpeg’,
tileMatrixSetID : ‘default028mm’,
});
widget.imageryLayers.addImageryProvider(landsat);
I don’t think there is a way to do this automatically. You can try using the minimumLevel option if you know tiles only exist below a certain level. You need to be careful setting this number too high though because Cesium will try to load every tile from that level if your application is zoomed out all the way.
You can use that in conjunction with the rectangle option if you know the tiles only exist within a certain extent.
minimumLevel and rectangle option of the layer seem to be what I'm looking for, but it actually throws an error with WebMapTileServiceImageryProvider saying:
"The imagery provider's rectangle and minimumLevel indicate that there are 16 tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported."
With WebMapServiceImageryProvider I can get it working with these options but I need to use WMTS...
Do you know what can I do to have the same behavior with WebMapTileServiceImageryProvider ?
Hmm, sorry I wasn’t aware that was a restriction for our WMTS provider. That doesn’t seem to be in place for our other imagery providers. I’ve written up an issue to find out if we can get rid of this check or raise the threshold: https://github.com/AnalyticalGraphicsInc/cesium/issues/4372
Thanks Hannah, I tried to comment those lines but unfortunately I stumbled upon something else after doing so :
"TypeError: Cannot read property 'south' of undefined"
from ImageryLayer._createTileImagerySkeletons (http://cesiumjs.org/Cesium/Source/Scene/ImageryLayer.js:562:62)
It does not seem to be specific to WebMapTileServiceImageryProvider but more dependent of the rectangle,
this sandcastle code can reproduce the error with a WebMapServiceImageryProvider :
var widget = new Cesium.CesiumWidget(‘cesiumContainer’);
var provider = new Cesium.WebMapServiceImageryProvider({
url : ’ http://ows.terrestris.de/osm/service?’,
layers : ‘OSM-WMS’,
rectangle : Cesium.Rectangle.fromDegrees(149.0625, -36.5625, 154.6875, -30.9375),
minimumLevel : 6,
});
widget.imageryLayers.addImageryProvider(provider);
For now I decided to stay with the current limitation of maximum 4 tiles at minimum level and modified my WMTS server to produce more levels on the fly but I'd prefer to disable this as soon as we find a solution.
Thanks for sending over the code example! I’m not too familiar with how this works, so I’m not sure if it’s a bug in Cesium or a problem with using the imagery provider options incorrectly. Regardless, I filed an issue report on our GitHub so we can look into it further: https://github.com/AnalyticalGraphicsInc/cesium/issues/4377
Glad you were able to find a workaround in the meantime