<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Adding layers dynamically to the map are not visible..... in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/adding-layers-dynamically-to-the-map-are-not/m-p/217851#M5110</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to add layers dynamically to the map component by using the following code with a button click.....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for(var i:int=0;i&amp;lt;4;i++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGISDynamicserviceLayer dyn=new ArcGISDynamicLayer(//URL);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dyn.VisibleLayers=//Some visible Layers array collection....&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myMap.addLayer(dyn,i);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When i am adding first time it is adding successfully....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But when i remove all the layers i have added and i tried add another set of layers like this with another button click the new set of layers are not visible on the map.....&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When i am checking the number of layers on map it showing the count and all urls also....What is the reason for this.....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks &amp;amp; Regards &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Srinivas..............&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Jul 2012 06:02:15 GMT</pubDate>
    <dc:creator>srinivasreddy</dc:creator>
    <dc:date>2012-07-18T06:02:15Z</dc:date>
    <item>
      <title>Adding layers dynamically to the map are not visible.....</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/adding-layers-dynamically-to-the-map-are-not/m-p/217851#M5110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to add layers dynamically to the map component by using the following code with a button click.....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for(var i:int=0;i&amp;lt;4;i++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGISDynamicserviceLayer dyn=new ArcGISDynamicLayer(//URL);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dyn.VisibleLayers=//Some visible Layers array collection....&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myMap.addLayer(dyn,i);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When i am adding first time it is adding successfully....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But when i remove all the layers i have added and i tried add another set of layers like this with another button click the new set of layers are not visible on the map.....&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When i am checking the number of layers on map it showing the count and all urls also....What is the reason for this.....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks &amp;amp; Regards &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Srinivas..............&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2012 06:02:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/adding-layers-dynamically-to-the-map-are-not/m-p/217851#M5110</guid>
      <dc:creator>srinivasreddy</dc:creator>
      <dc:date>2012-07-18T06:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Adding layers dynamically to the map are not visible.....</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/adding-layers-dynamically-to-the-map-are-not/m-p/217852#M5111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you sure all the dynamic map services are in the same projection? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe the map service is being added successfully but it's off in never never land.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe create a function to zoom to the new map layer you added to see if you can locate it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The function below will allow you to quickly zoom to it.. &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
private function zoomToMapLayer():void
{
 myMap.extent = myDynamicLayer.fullExtent;
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Drew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:38:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/adding-layers-dynamically-to-the-map-are-not/m-p/217852#M5111</guid>
      <dc:creator>Drew</dc:creator>
      <dc:date>2021-12-11T10:38:43Z</dc:date>
    </item>
  </channel>
</rss>

