Recently updated API version from 4.19 to 4.22 and as a result, my WMTS-layer zoom-property is stuck on -1 which of course has other consequences. This has been working fine for a long time with both 4.16 and 4.19. If I go back to 4.19 it starts working again. The code is pretty straightforward and I can see no changes in the documentation that would affect this. JS console says nothing.
Solved! Go to Solution.
Hi there,
Can you please try setting MapView.constraints.lods by calling TileInfo.create() method in your app? I tested this and it works. Also, I noticed that it does not work for me in 4.19. In any case, we will create an issue on our side to set the MapView's tileInfo when wmtslayer is added.
Please check out this test app to see how to set the MapView's tileInfo and how this sets the zoom levels accordingly. In the test app, I am setting the LODs to ArcGIS online tiling info. It is documented in TileInfo.create doc referenced above.
Can you provide a service URL to testify against? Not seeing this behavior with current ones used in samples, could be something in how the capabilities are parsed for some services.
My URL is with key authorization but actually I AM seeing the same problem in this sample:
https://developers.arcgis.com/javascript/latest/sample-code/layers-wmts/
Adding the following after view.when will show view.zoom=-1 and no effectiveLODs.
view.watch('scale', function (newScale) {
console.log('Scale: ', view.scale)
console.log('Zoom: ', view.zoom)
console.log('Resolution: ', view.resolution)
console.log('Effective LODS: ', view.constraints.effectiveLODs)
})
Hi there,
Can you please try setting MapView.constraints.lods by calling TileInfo.create() method in your app? I tested this and it works. Also, I noticed that it does not work for me in 4.19. In any case, we will create an issue on our side to set the MapView's tileInfo when wmtslayer is added.
Please check out this test app to see how to set the MapView's tileInfo and how this sets the zoom levels accordingly. In the test app, I am setting the LODs to ArcGIS online tiling info. It is documented in TileInfo.create doc referenced above.
Thank you, it worked great!
I just want to add that after adding the Tileinfo.create() I have the exact same issue as another user regarding the zoom property in Mapview that is reported in "Issue with 4.22 and zoom property". There is definitely something fishy going on with zoom/LODs for some layers in 4.22...