I need to get some feature layers from a Web Map I created, using the ESRI JavaScript 3.x (it could be in any version while it's on the 3)
Marvin,
It is as simple as:
<SPAN class="keyword token">var</SPAN> myLayer <SPAN class="operator token">=</SPAN> map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">getLayer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"USA_Tapestry_335"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
Do you have to hard-code the value? Isn't it possible to just do something like:
var activeLayers = this.map.getLayers(); // process layers in a for-each loop or similar...
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.