Some FeatureLayers are added to map. How to retrieve one feature layer from map object? I have tried
map.getLayer(map.layerIds[x]), the object is not FeatureLayer type object.
Solved! Go to Solution.
with the following
map.getLayer('MapServiceWeb_Operational_7147');
you are getting the map layer setting the layer id.
with the following
map.getLayer('MapServiceWeb_Operational_7147');
you are getting the map layer setting the layer id.
Baohoa,
A FeatureLayer is always added to the map.graphicsLayerIds array and not the map.layerIds array. So the code would look like:
map.getLayer(map.graphicsLayerIds[x]);
Or if you know the exact layer id the you can use the code Panagiotis provided.
Thank you so much for your guidance.