<?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: Adding multiple layers from a map server (points, lines, and polgons.) in Kotlin Maps SDK Questions</title>
    <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/adding-multiple-layers-from-a-map-server-points/m-p/1315120#M190</link>
    <description>&lt;P&gt;Yesterday I was able to create a block of code as follows&lt;/P&gt;&lt;P&gt;// create a map with the BasemapStyle topographic&lt;BR /&gt;val map = ArcGISMap(BasemapStyle.ArcGISImagery)&lt;/P&gt;&lt;P&gt;// Create an ArcGIS Map Image Layer for the ESRI map server layer&lt;BR /&gt;val mapServiceUrl = "https://.../MapServer"&lt;BR /&gt;val mapImageLayer = ArcGISMapImageLayer(mapServiceUrl)&lt;/P&gt;&lt;P&gt;// load sublayers of mapServiceUrl&lt;BR /&gt;val hospitalSublayer = ArcGISMapImageSublayer(1).apply {name = "Hospital"}&lt;/P&gt;&lt;P&gt;.......list of 35 sublayers&lt;/P&gt;&lt;P&gt;// create a group layer from scratch by adding the Sublayers as children&lt;BR /&gt;val mapSublayers = GroupLayer().apply {&lt;BR /&gt;name ="Group Base Map"&lt;BR /&gt;addAll(arrayListOf(, hospitalSublayer, ...35 sublayers listed out))&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;basemap.operationalLayers.add(mapImageLayer)&lt;BR /&gt;basemap.operationalLayers.add(mapSublayers)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting an error at "name ='Group Base Map'" where Android Studio throws "Val cannot be reassigned."&amp;nbsp; AS highlights "name" in the list block of 35 sub-layers where I load sublayers of mapServiceUrl. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Aug 2023 16:35:30 GMT</pubDate>
    <dc:creator>klebercj</dc:creator>
    <dc:date>2023-08-03T16:35:30Z</dc:date>
    <item>
      <title>Adding multiple layers from a map server (points, lines, and polgons.)</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/adding-multiple-layers-from-a-map-server-points/m-p/1313874#M182</link>
      <description>&lt;P&gt;I have a map server url from an ArcGIS REST Services.&amp;nbsp; The ......../MapServer url contains 35 layers of point, line, and polygon features.&amp;nbsp; I need to bring in all of&amp;nbsp; them and have the ability to turn each on on and off.&amp;nbsp; I know I can bring in each one individually, but that's 35 variables for each individual url (..../MapServer/0, 1, 2 etc...)&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now I only know how to utilize the method shown in this turorial; &lt;A href="https://developers.arcgis.com/kotlin/layers/tutorials/add-a-feature-layer/" target="_blank"&gt;https://developers.arcgis.com/kotlin/layers/tutorials/add-a-feature-layer/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Is there a way crawl the top level MapServer url and bring in the 35 layers, but still be able to individually control each layer i.e. make visible / invisible?&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 22:35:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/adding-multiple-layers-from-a-map-server-points/m-p/1313874#M182</guid>
      <dc:creator>klebercj</dc:creator>
      <dc:date>2023-07-31T22:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Adding multiple layers from a map server (points, lines, and polgons.)</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/adding-multiple-layers-from-a-map-server-points/m-p/1314711#M189</link>
      <description>&lt;P&gt;You can add the top level MapServer url as an&amp;nbsp;ArcGISMapImageLayer&amp;nbsp;&lt;A href="https://developers.arcgis.com/kotlin/api-reference/arcgis-maps-kotlin/com.arcgismaps.mapping.layers/-arc-g-i-s-map-image-layer/index.html" target="_blank"&gt;https://developers.arcgis.com/kotlin/api-reference/arcgis-maps-kotlin/com.arcgismaps.mapping.layers/-arc-g-i-s-map-image-layer/index.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After that you can control each &lt;A href="https://developers.arcgis.com/kotlin/api-reference/arcgis-maps-kotlin/com.arcgismaps.mapping.layers/-arc-g-i-s-sublayer/index.html" target="_self"&gt;Sublayer&lt;/A&gt;'s properties. You can see the API usage with this Android Java sample.&amp;nbsp;&lt;BR /&gt;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-android/blob/main/java/change-sublayer-visibility/src/main/java/com/esri/arcgisruntime/sample/mapimagelayersublayervisibility/MainActivity.java" target="_blank"&gt;https://github.com/Esri/arcgis-runtime-samples-android/blob/main/java/change-sublayer-visibility/src/main/java/com/esri/arcgisruntime/sample/mapimagelayersublayervisibility/MainActivity.java&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/kotlin/api-reference/arcgis-maps-kotlin/com.arcgismaps.mapping.layers/-arc-g-i-s-sublayer/index.html#-1515161094%2FProperties%2F1086730362" target="_blank"&gt;https://developers.arcgis.com/kotlin/api-reference/arcgis-maps-kotlin/com.arcgismaps.mapping.layers/-arc-g-i-s-sublayer/index.html#-1515161094%2FProperties%2F1086730362&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 18:08:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/adding-multiple-layers-from-a-map-server-points/m-p/1314711#M189</guid>
      <dc:creator>PuneetPrakash</dc:creator>
      <dc:date>2023-08-02T18:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Adding multiple layers from a map server (points, lines, and polgons.)</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/adding-multiple-layers-from-a-map-server-points/m-p/1315120#M190</link>
      <description>&lt;P&gt;Yesterday I was able to create a block of code as follows&lt;/P&gt;&lt;P&gt;// create a map with the BasemapStyle topographic&lt;BR /&gt;val map = ArcGISMap(BasemapStyle.ArcGISImagery)&lt;/P&gt;&lt;P&gt;// Create an ArcGIS Map Image Layer for the ESRI map server layer&lt;BR /&gt;val mapServiceUrl = "https://.../MapServer"&lt;BR /&gt;val mapImageLayer = ArcGISMapImageLayer(mapServiceUrl)&lt;/P&gt;&lt;P&gt;// load sublayers of mapServiceUrl&lt;BR /&gt;val hospitalSublayer = ArcGISMapImageSublayer(1).apply {name = "Hospital"}&lt;/P&gt;&lt;P&gt;.......list of 35 sublayers&lt;/P&gt;&lt;P&gt;// create a group layer from scratch by adding the Sublayers as children&lt;BR /&gt;val mapSublayers = GroupLayer().apply {&lt;BR /&gt;name ="Group Base Map"&lt;BR /&gt;addAll(arrayListOf(, hospitalSublayer, ...35 sublayers listed out))&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;basemap.operationalLayers.add(mapImageLayer)&lt;BR /&gt;basemap.operationalLayers.add(mapSublayers)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting an error at "name ='Group Base Map'" where Android Studio throws "Val cannot be reassigned."&amp;nbsp; AS highlights "name" in the list block of 35 sub-layers where I load sublayers of mapServiceUrl. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 16:35:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/adding-multiple-layers-from-a-map-server-points/m-p/1315120#M190</guid>
      <dc:creator>klebercj</dc:creator>
      <dc:date>2023-08-03T16:35:30Z</dc:date>
    </item>
  </channel>
</rss>

