Are these actual CSVLayer() layers? If so, they should have a "visible" property:https://developers.arcgis.com/javascript/jsapi/csvlayer-amd.html#visibleso reading yourCSVLayerName.visible should return true or false.Actually, other types of layers have the same "visible" property:https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#visiblehttps://developers.arcgis.com/javascript/jsapi/arcgisdynamicmapservicelayer-amd.html#visibleSo you can just write some logic to check for that like:if (!yourCSVLayerName.visible) { yourCSVLayerName.show(); } Or you could do something like this: function getLayerProperties() { for(var j = 0; j < map.layerIds.length; j++) { var layer = map.getLayer(map.layerIds); if (!layer.visible) { //if layer is not visible layer.show(); } } } }
if (!yourCSVLayerName.visible) { yourCSVLayerName.show(); }
function getLayerProperties() { for(var j = 0; j < map.layerIds.length; j++) { var layer = map.getLayer(map.layerIds); if (!layer.visible) { //if layer is not visible layer.show(); } } } }
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.