Hello,
I have a WMTS server having only data from zoom levels 6 to 16 and want to display its tiles in Cesium. According to the API reference of the WebMapTileServiceImageryProvider (https://cesiumjs.org/Cesium/Build/Documentation/WebMapTileServiceImageryProvider.html#WebMapTileServiceImageryProvider), I should be able to use the 'minimumLevel' and 'maximumLevel' properties to indicate the available tile range.
I used the following code (the URL is not the one I used, as my server is not accessible from Internet):
var viewer = new Cesium.Viewer('cesiumContainer');
var wmts = new Cesium.WebMapTileServiceImageryProvider({
layer : 'USGSImageryTopo',
style : 'default',
format : 'image/png',
tileMatrixSetID : 'default028mm',
minimumLevel: 6,
maximumLevel: 16
});
viewer.imageryLayers.addImageryProvider(wmts);
I get the following error: "Uncaught DeveloperError: The imagery provider's rectangle and minimumLevel indicate that there are 4096 tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported."
I guess the reason why Cesium tries to download data from zoom level 6 when the view is currently at zoom level 0 is to "compute" the missing tiles from higher level ones.
I tried creating an ImageryLayer and specifying the minimumTerrainLevel, but that's not valid workaround, because the check is done in the WebMapTileServiceImageryProvider constructor (https://github.com/AnalyticalGraphicsInc/cesium/blob/3ef9dad02f4be88894e58501a602118008c5b5c6/Source/Scene/WebMapTileServiceImageryProvider.js#L214).
The only workaround I could find was that, if you work on a relatively small area, you can specify your extent of interest with the 'rectangle' property of the options.
I see there was an issue created to raise the allowed number of tiles at minimum level (https://github.com/AnalyticalGraphicsInc/cesium/issues/4372).
But would not it be better to totally disable this "extrapolation" mechanism" when it is not wanted?
It could be done like that:
if (defined(imageryProvider.minimumLevel)) {
var minimumLevel = imageryProvider.minimumLevel;
if (imageryLevel < minimumLevel) {
imageryLevel = minimumLevel;
}
}
by something like:
if (defined(imageryProvider.minimumLevel)) {
var minimumLevel = imageryProvider.minimumLevel;
if (imageryLevel < minimumLevel) {
if (this.extrapolateLowerLevelTiles) {
imageryLevel = minimumLevel;
} else {
// Do not create missing tiles from higher level ones.
return false;
}
}
}
Would it be of any interest for the product?
Best regards
--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.