<?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 Re: Move or reorder layers in mapview in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-or-reorder-layers-in-mapview/m-p/434657#M2949</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Did you look at the &lt;A href="http://resources.arcgis.com/en/help/android-sdk/api/com/esri/android/map/MapView.html#addLayer(com.esri.android.map.Layer, int)"&gt;addLayer(Layer layer, int index)&lt;/A&gt;&amp;nbsp; method? You can add a layer using an index. Conversely, you can also remove a layer using &lt;A href="http://resources.arcgis.com/en/help/android-sdk/api/com/esri/android/map/MapView.html#removeLayer(int)"&gt;removeLayer(int index)&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;-Andy&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes.&amp;nbsp; I am using those methods.&amp;nbsp; I have the map index and name saved as a tag on the arrow, so I know which layer to remove and add back in.&amp;nbsp; Just need to work out the logic.&amp;nbsp; It works one time, but the next time I move a layer it is moved two layers down rather than one.&amp;nbsp; So need to figure what I am doing wrong in the code.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Aug 2012 18:46:10 GMT</pubDate>
    <dc:creator>LukeCatania</dc:creator>
    <dc:date>2012-08-08T18:46:10Z</dc:date>
    <item>
      <title>Move or reorder layers in mapview</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-or-reorder-layers-in-mapview/m-p/434653#M2945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a way to move or reorder layers in a mapview?&amp;nbsp; I have a list of map layers with a check box next to each along with up and down arrows.&amp;nbsp; I want to give the user the ability to move a layer up or down so they appear over or the current map or pushed under the current map.&amp;nbsp; At the moment I am trying to add a listener to each arrow that would remove the layer and add the layer back into the mapview into a different position.&amp;nbsp; Anyone have a better solution.&amp;nbsp; Would be nice to have a moveUp and moveDown method on a layer or mapview.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am also running into the issue that I build the menu as the layers are read off the sdcard but I also add the layers as they are read, so the menu built shows the layer in reverse order.&amp;nbsp; That is the top most layer shown in the list is actually the bottom layer in the mapview.&amp;nbsp; I need it reversed, so the layer listed at the top is topmost layer in the mapview.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 18:43:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-or-reorder-layers-in-mapview/m-p/434653#M2945</guid>
      <dc:creator>LukeCatania</dc:creator>
      <dc:date>2012-07-31T18:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: Move or reorder layers in mapview</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-or-reorder-layers-in-mapview/m-p/434654#M2946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Anybody with good hints or tips regarding how to re-order layers?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to be able to have an option that changes the base-map, and at the moment I'm thinking I will need to remove all layers, add the new base map and then add all other layers again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any better ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 13:28:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-or-reorder-layers-in-mapview/m-p/434654#M2946</guid>
      <dc:creator>NicoTek</dc:creator>
      <dc:date>2012-08-07T13:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Move or reorder layers in mapview</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-or-reorder-layers-in-mapview/m-p/434655#M2947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I did the same in my app. I couldn't think of any other solution. I did it with v1.1 of the SDK. In the changelog for v2 it says there is a way to change the basemap, but so far I didn't see anything.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can get the basemaps of a webmap, but there is no good way (at least for my use case) to easily add a new basemap to an existing webmap.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 19:05:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-or-reorder-layers-in-mapview/m-p/434655#M2947</guid>
      <dc:creator>SimonKlein</dc:creator>
      <dc:date>2012-08-07T19:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Move or reorder layers in mapview</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-or-reorder-layers-in-mapview/m-p/434656#M2948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you look at the &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/android-sdk/api/com/esri/android/map/MapView.html#addLayer(com.esri.android.map.Layer, int)"&gt;addLayer(Layer layer, int index)&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp; method? You can add a layer using an index. Conversely, you can also remove a layer using &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/android-sdk/api/com/esri/android/map/MapView.html#removeLayer(int)"&gt;removeLayer(int index)&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Andy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2012 18:32:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-or-reorder-layers-in-mapview/m-p/434656#M2948</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2012-08-08T18:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Move or reorder layers in mapview</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-or-reorder-layers-in-mapview/m-p/434657#M2949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Did you look at the &lt;A href="http://resources.arcgis.com/en/help/android-sdk/api/com/esri/android/map/MapView.html#addLayer(com.esri.android.map.Layer, int)"&gt;addLayer(Layer layer, int index)&lt;/A&gt;&amp;nbsp; method? You can add a layer using an index. Conversely, you can also remove a layer using &lt;A href="http://resources.arcgis.com/en/help/android-sdk/api/com/esri/android/map/MapView.html#removeLayer(int)"&gt;removeLayer(int index)&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;-Andy&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes.&amp;nbsp; I am using those methods.&amp;nbsp; I have the map index and name saved as a tag on the arrow, so I know which layer to remove and add back in.&amp;nbsp; Just need to work out the logic.&amp;nbsp; It works one time, but the next time I move a layer it is moved two layers down rather than one.&amp;nbsp; So need to figure what I am doing wrong in the code.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2012 18:46:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-or-reorder-layers-in-mapview/m-p/434657#M2949</guid>
      <dc:creator>LukeCatania</dc:creator>
      <dc:date>2012-08-08T18:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Move or reorder layers in mapview</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-or-reorder-layers-in-mapview/m-p/434658#M2950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not sure if this will help or not since it's not the exact code you are asking about. However, this snippet shows one example for iterating through the layers and work with the various properties:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Layer[] layerArr = map.getLayers();
for(Layer layer : layerArr)
{
 Boolean visible = layer.isVisible();
 if(layer instanceof ArcGISTiledMapServiceLayer &amp;amp;&amp;amp; visible == true){
&amp;nbsp; ArcGISTiledMapServiceLayer tempMap = (ArcGISTiledMapServiceLayer) layer;
&amp;nbsp; ArcGISLayerInfo[] info = tempMap.getLayers();
&amp;nbsp; Log.d("test","Layer name= " + tempMap.getName() + ", " + info[0].getName());
&amp;nbsp; String name = info[0].getName().toLowerCase();
&amp;nbsp; Boolean vis = info[0].isVisible();

&amp;nbsp; if(name.equals("world street map")){
&amp;nbsp;&amp;nbsp; layerButton.setText("Topo");
&amp;nbsp;&amp;nbsp; streetLayer.setVisible(false);
&amp;nbsp;&amp;nbsp; topoLayer.setVisible(true);
&amp;nbsp; }
&amp;nbsp; if(name.equals("topographic info")){
&amp;nbsp;&amp;nbsp; layerButton.setText("Streets");
&amp;nbsp;&amp;nbsp; streetLayer.setVisible(true);
&amp;nbsp;&amp;nbsp; topoLayer.setVisible(false);
&amp;nbsp; }
&amp;nbsp; 
 }
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Andy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:29:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-or-reorder-layers-in-mapview/m-p/434658#M2950</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2021-12-11T19:29:00Z</dc:date>
    </item>
  </channel>
</rss>

