I'm using ArcGIS Javascript API for a web application. I have a WMTS – OGC Web Service URL "https://svc.pictometry.com/Image/**********/wmts" which has multiple layers, so I have to add a layer from this service as a basemap to the map.
Referred the sample code from the ArcGIS API for javascript sample=layers-wmts
var customBasemapLayer = new this.esri.WMTSLayer({
url: "https://svc.pictometry.com/Image/**********/wmts",
activeLayer: {
id: "******"
}
});
this.map.add(customBasemapLayer);
the above code does not work for me. is there an alternate solution for this?
Your pseudo code looks correct - depending on the rest of your app.
Here's a working example for Pictometry:
const layer = new WMTSLayer({
url: "https://svc.pictometry.com/Image/26963D57-1E85-F308-2F17-9EB85101B1DC/wmts",
copyright: "Pictometry",
activeLayer: {
id: "PICT-CASANL21-ghAPblT72Z"
}
});
Example app - https://codepen.io/bsvensson/pen/RwjeXYE
hi @BjornSvensson thanks for the reply.
i tried your example app, but its throwing console errors
how to handle these errors?
@YashvitNaik - seems like the "PICT-CASANL21-ghAPblT72Z" no longer exists in that service you reference above. If I change it to another layername like PICT-HIKAUA12-LIK2Cqnhav (that exists), and then zoom in a level or two, it seems to work fine.