Hi, so I'm working on creating a custom widget that will export the data of a layer into a CSV file. But I'm stuck on the part where I have to retrieve the layer ID of the layer I want to export. This is how I'm trying to do it.
const featureLayer = jimuMapView.view.map.findLayerById('layerid') as esri.FeatureLayer;
layerid is where the retrieved ID would go. Thx in advance.
Hi ShahranNewaz,
Is your problem that you don't know the id of the layer to be exported? If you don’t know the layer id, how do you know which layer to export?
https://developers.arcgis.com/javascript/latest/api-reference/esri-Map.html#allLayers
The simplest way to find the id of a layer if you don't know it is to console log all layers and look through the results with your browser tools.
console.log(jimuMapView.view.map.allLayers)