Select to view content in your preferred language

Set TileMatrixSetId for WMTS

37
0
3 hours ago
tomasivan
New Member

Hi, I have MapView with basemap (wkid 5514). When I add this specific WMTS layer : https://services.sentinel-hub.com/ogc/wmts/9c4df810-8939-4ef5-9962-fd51bf66ece8

it is rendered on wrong place, it is moved hundreds kilometers to north. 

The same behaviour can be simulated on online arcgis map viewer, when setting this wmts as basemap first : 

https://zbgisws.skgeodesy.sk/zbgis_ortofoto_wmts/service.svc/get

Problem is with the sentinel layer and tileMatrixSet used : CZE, which supports urn:ogc:def:crs:EPSG::5514,  but its tile sizes height != width : 
<TileWidth>512</TileWidth>
<TileHeight>286</TileHeight>

I can fix this problem in ArcGis online viewer using another tileMatrixSetId : UTM33N, which could be acceptable. 
But I'm not able to set this tileMatrixSet when creating WMTSLayer : 


let wmtsOptions = {...basicLayerOptions,
spatialReference: this.mapView.spatialReference,
};
wmtsOptions['activeLayer'] = {id: parameters.activeLayer};
wmtsOptions['tileMatrixSetId'] = tileMatrixSet;
wmtsOptions['tileMatrixSet'] = tileMatrixSet;

lyr = new WMTSLayer(wmtsOptions);

 

I tried to set tileMatrixSetId for sublayers too : 


lyr.load().then(() => {
let sublayers = (lyr as WMTSLayer).sublayers;
let activeLayer = (lyr as any).activeLayer;
if(activeLayer){
activeLayer.tileMatrixSetId = tileMatrixSet;
}
if(sublayers?.length){
sublayers.forEach(sublayer => {
sublayer.tileMatrixSetId = tileMatrixSet;
});
}

console.log('sublayers: ', sublayers);
console.log('activeLayer: ', activeLayer);
});

I can see in console, that tileMatrixSetId is set to UTM33N, bet the request sent by browser have still TILEMATRIXSET=CZE.

How can I specify the the tileMatrixSet for WMTS layer ? 

 

0 Kudos
0 Replies