<?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: FeatureLayer Selection Mode in ArcGIS for Android 100.0.0 in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-selection-mode-in-arcgis-for-android/m-p/93354#M709</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply!&lt;/P&gt;&lt;P&gt;I tried your suggestion, but setting &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;buildings&lt;/SPAN&gt;.setFeatureVisible(feature, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;true&lt;/SPAN&gt;); after initially setting visible to "none" didn't work. So in my buildings.selectFeatureAsync task, I added:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;buildings&lt;/SPAN&gt;.setVisible(&lt;SPAN style="color: #000080; font-weight: bold;"&gt;true&lt;/SPAN&gt;);
Map&amp;lt;&lt;SPAN style="background-color: #e4e4ff;"&gt;String&lt;/SPAN&gt;, Object&amp;gt; attr = feature.getAttributes();
Object value = (&lt;SPAN style="background-color: #e4e4ff;"&gt;String&lt;/SPAN&gt;) attr.get(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"piz"&lt;/SPAN&gt;);
&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;buildings&lt;/SPAN&gt;.setDefinitionExpression(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"piz LIKE '"&lt;/SPAN&gt;+value+&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"'"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;where "piz" is the name for the unique ID of the building. At first this did not work either, since my feature service contains many fields and only the first couple of fields were actually returned; I also couldn't specify outfields as I used to do in the old API. So I tried this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ServiceFeatureTable table = (ServiceFeatureTable) &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;buildings&lt;/SPAN&gt;.getFeatureTable();
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;final &lt;/SPAN&gt;ListenableFuture&amp;lt;FeatureQueryResult&amp;gt; future = 
table.queryFeaturesAsync(query, ServiceFeatureTable.QueryFeatureFields.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;LOAD_ALL&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;and now the definition query works because the piz field value is returned. &lt;BR /&gt;However, I do hope that there is an easier way of doing this (or maybe will be added to the API in the future) &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 23:34:25 GMT</pubDate>
    <dc:creator>LageplanGöttingen</dc:creator>
    <dc:date>2021-12-10T23:34:25Z</dc:date>
    <item>
      <title>FeatureLayer Selection Mode in ArcGIS for Android 100.0.0</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-selection-mode-in-arcgis-for-android/m-p/93352#M707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;prior to 100.0.0 I used to load my feature services as follows:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ArcGISFeatureLayer &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;buildings &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;ArcGISFeatureLayer(getResources().getString(&lt;/PRE&gt;R.string.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;buildingsURL&lt;/SPAN&gt;), ArcGISFeatureLayer.MODE.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;SELECTION&lt;/SPAN&gt;);&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;map&lt;/SPAN&gt;.addLayer(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;buildings&lt;/SPAN&gt;);
&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;map&lt;/SPAN&gt;.addLayer(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;rooms&lt;/SPAN&gt;);
...

I.e., my building and room features would not be displayed by default, 
but only when they were selected.
There also used to be the modes "ONDEMAND" and "SNAPSHOT",&amp;nbsp; 
but the SELECTION mode is most important for my app.

For 100.0.0 I changed the code to this:
&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ServiceFeatureTable buildingsTable = 
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;ServiceFeatureTable(getResources().getString(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R.string.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;buildingsURL&lt;/SPAN&gt;));
&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;buildings &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;FeatureLayer(buildingsTable);
&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;map&lt;/SPAN&gt;.getOperationalLayers().add(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;buildings&lt;/SPAN&gt;);
&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;map&lt;/SPAN&gt;.getOperationalLayers().add(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;rooms&lt;/SPAN&gt;);
...

I could not find a "SELECTION" mode and all buildings (or rooms) are displayed 
at the same time. 
Moreover, I realized that only the first layer is displayed (in this case, buildings; 
if I add rooms as the first layer, then all rooms are shown).
But this is a different problem...

So first of all, could someone please tell me how I can add feature layers 
so that features are loaded from the server only when they are selected?

Thank you!&lt;/PRE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:34:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-selection-mode-in-arcgis-for-android/m-p/93352#M707</guid>
      <dc:creator>LageplanGöttingen</dc:creator>
      <dc:date>2021-12-10T23:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer Selection Mode in ArcGIS for Android 100.0.0</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-selection-mode-in-arcgis-for-android/m-p/93353#M708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't see this mode currently available. &amp;nbsp;Someone from the Runtime team might be able to comment on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What &amp;nbsp;you could do though, is load the layer but set the visibility to none. &amp;nbsp;Then as the user queries for a feature or selects a feature, you can at that point change the visibility of the selected feature using&amp;nbsp;&lt;A href="https://developers.arcgis.com/android/latest/api-reference/reference/com/esri/arcgisruntime/layers/FeatureLayer.html#setFeatureVisible(com.esri.arcgisruntime.data.Feature, boolean)"&gt;this method.&lt;/A&gt;&amp;nbsp;While this may not be ideal for your workflow, I believe that this may be a reasonable alternative.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully, we will be able to get some feedback from a member of the runtime team regarding that method / feature you are looking for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 18:23:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-selection-mode-in-arcgis-for-android/m-p/93353#M708</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2017-04-20T18:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer Selection Mode in ArcGIS for Android 100.0.0</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-selection-mode-in-arcgis-for-android/m-p/93354#M709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply!&lt;/P&gt;&lt;P&gt;I tried your suggestion, but setting &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;buildings&lt;/SPAN&gt;.setFeatureVisible(feature, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;true&lt;/SPAN&gt;); after initially setting visible to "none" didn't work. So in my buildings.selectFeatureAsync task, I added:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;buildings&lt;/SPAN&gt;.setVisible(&lt;SPAN style="color: #000080; font-weight: bold;"&gt;true&lt;/SPAN&gt;);
Map&amp;lt;&lt;SPAN style="background-color: #e4e4ff;"&gt;String&lt;/SPAN&gt;, Object&amp;gt; attr = feature.getAttributes();
Object value = (&lt;SPAN style="background-color: #e4e4ff;"&gt;String&lt;/SPAN&gt;) attr.get(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"piz"&lt;/SPAN&gt;);
&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;buildings&lt;/SPAN&gt;.setDefinitionExpression(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"piz LIKE '"&lt;/SPAN&gt;+value+&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"'"&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;where "piz" is the name for the unique ID of the building. At first this did not work either, since my feature service contains many fields and only the first couple of fields were actually returned; I also couldn't specify outfields as I used to do in the old API. So I tried this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ServiceFeatureTable table = (ServiceFeatureTable) &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;buildings&lt;/SPAN&gt;.getFeatureTable();
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;final &lt;/SPAN&gt;ListenableFuture&amp;lt;FeatureQueryResult&amp;gt; future = 
table.queryFeaturesAsync(query, ServiceFeatureTable.QueryFeatureFields.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;LOAD_ALL&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;and now the definition query works because the piz field value is returned. &lt;BR /&gt;However, I do hope that there is an easier way of doing this (or maybe will be added to the API in the future) &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:34:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-selection-mode-in-arcgis-for-android/m-p/93354#M709</guid>
      <dc:creator>LageplanGöttingen</dc:creator>
      <dc:date>2021-12-10T23:34:25Z</dc:date>
    </item>
  </channel>
</rss>

