<?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 How to get data from all sublayers from ServiceFeatureTable? I am able to fetch layer details on basis of touch point. in Esri India Questions</title>
    <link>https://community.esri.com/t5/esri-india-questions/how-to-get-data-from-all-sublayers-from/m-p/35374#M7</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below code is working for screenpoint and get details from it:-&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #808080;"&gt;/**
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; * Performs an identify on layers at the given screenpoint and calls handleIdentifyResults(...) to process them.
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; */
&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;private void &lt;/SPAN&gt;identifyResult(android.graphics.Point screenPoint) {
    &lt;SPAN style="color: #000080; font-weight: bold;"&gt;final &lt;/SPAN&gt;ListenableFuture&amp;lt;List&amp;lt;IdentifyLayerResult&amp;gt;&amp;gt; identifyLayerResultsFuture = map
            .identifyLayersAsync(screenPoint, &lt;SPAN style="color: #0000ff;"&gt;12&lt;/SPAN&gt;, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;false&lt;/SPAN&gt;, &lt;SPAN style="color: #0000ff;"&gt;10&lt;/SPAN&gt;);
    identifyLayerResultsFuture.addDoneListener(() -&amp;gt; {
        &lt;SPAN style="color: #000080; font-weight: bold;"&gt;try &lt;/SPAN&gt;{
            List&amp;lt;IdentifyLayerResult&amp;gt; identifyLayerResults = identifyLayerResultsFuture.get();
            handleIdentifyResults(identifyLayerResults);
        } &lt;SPAN style="color: #000080; font-weight: bold;"&gt;catch &lt;/SPAN&gt;(InterruptedException | ExecutionException e) {
            Log.e(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"main"&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Error identifying results: " &lt;/SPAN&gt;+ e.getMessage());
        } &lt;SPAN style="color: #000080; font-weight: bold;"&gt;catch &lt;/SPAN&gt;(Exception e) {
            e.printStackTrace();
        }
    });
}

&lt;SPAN style="color: #808080;"&gt;/**
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; * Processes identify results into a string which is passed to showAlertDialog(...)
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; *
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-weight: bold;"&gt;@param &lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;identifyLayerResults a list of identify results generated in identifyResult().
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; */
&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;private void &lt;/SPAN&gt;handleIdentifyResults(List&amp;lt;IdentifyLayerResult&amp;gt; identifyLayerResults) {
    &lt;SPAN style="color: #000080; font-weight: bold;"&gt;for &lt;/SPAN&gt;(IdentifyLayerResult identifyLayerResult : identifyLayerResults) {
        geoElementsCountFromResult(identifyLayerResult);
    }
}

&lt;SPAN style="color: #808080;"&gt;/**
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; * Gets a count of the GeoElements in the passed result layer
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; *
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-weight: bold;"&gt;@param &lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;result from a single layer.
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-weight: bold;"&gt;@return &lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;the total count of GeoElements.
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; */
&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;private void &lt;/SPAN&gt;geoElementsCountFromResult(IdentifyLayerResult result) {
    List&amp;lt;IdentifyLayerResult&amp;gt; tempResults = &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;ArrayList&amp;lt;&amp;gt;();
    tempResults.add(result);
    &lt;SPAN style="color: #000080; font-weight: bold;"&gt;int &lt;/SPAN&gt;index = &lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;;
    IdentifyLayerResult identifyResult = tempResults.get(index);
    &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(identifyResult.getSublayerResults().size() &amp;gt; &lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;) {
        String siteName = Objects.requireNonNull(identifyResult.getSublayerResults().get(index).getElements().get(index).getAttributes().get(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"SiteName"&lt;/SPAN&gt;)).toString();
        String siteCode = Objects.requireNonNull(identifyResult.getSublayerResults().get(index).getElements().get(index).getAttributes().get(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"SiteCode"&lt;/SPAN&gt;)).toString();
        getMarkerPopUp(siteName, siteCode);
    }
}

In case of getting all data from sublayers of map, i am getting jsonEbeddedExcpetion.

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 21:22:44 GMT</pubDate>
    <dc:creator>Puneetkumar</dc:creator>
    <dc:date>2021-12-10T21:22:44Z</dc:date>
    <item>
      <title>How to get data from all sublayers from ServiceFeatureTable? I am able to fetch layer details on basis of touch point.</title>
      <link>https://community.esri.com/t5/esri-india-questions/how-to-get-data-from-all-sublayers-from/m-p/35374#M7</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below code is working for screenpoint and get details from it:-&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #808080;"&gt;/**
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; * Performs an identify on layers at the given screenpoint and calls handleIdentifyResults(...) to process them.
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; */
&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;private void &lt;/SPAN&gt;identifyResult(android.graphics.Point screenPoint) {
    &lt;SPAN style="color: #000080; font-weight: bold;"&gt;final &lt;/SPAN&gt;ListenableFuture&amp;lt;List&amp;lt;IdentifyLayerResult&amp;gt;&amp;gt; identifyLayerResultsFuture = map
            .identifyLayersAsync(screenPoint, &lt;SPAN style="color: #0000ff;"&gt;12&lt;/SPAN&gt;, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;false&lt;/SPAN&gt;, &lt;SPAN style="color: #0000ff;"&gt;10&lt;/SPAN&gt;);
    identifyLayerResultsFuture.addDoneListener(() -&amp;gt; {
        &lt;SPAN style="color: #000080; font-weight: bold;"&gt;try &lt;/SPAN&gt;{
            List&amp;lt;IdentifyLayerResult&amp;gt; identifyLayerResults = identifyLayerResultsFuture.get();
            handleIdentifyResults(identifyLayerResults);
        } &lt;SPAN style="color: #000080; font-weight: bold;"&gt;catch &lt;/SPAN&gt;(InterruptedException | ExecutionException e) {
            Log.e(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"main"&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Error identifying results: " &lt;/SPAN&gt;+ e.getMessage());
        } &lt;SPAN style="color: #000080; font-weight: bold;"&gt;catch &lt;/SPAN&gt;(Exception e) {
            e.printStackTrace();
        }
    });
}

&lt;SPAN style="color: #808080;"&gt;/**
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; * Processes identify results into a string which is passed to showAlertDialog(...)
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; *
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-weight: bold;"&gt;@param &lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;identifyLayerResults a list of identify results generated in identifyResult().
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; */
&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;private void &lt;/SPAN&gt;handleIdentifyResults(List&amp;lt;IdentifyLayerResult&amp;gt; identifyLayerResults) {
    &lt;SPAN style="color: #000080; font-weight: bold;"&gt;for &lt;/SPAN&gt;(IdentifyLayerResult identifyLayerResult : identifyLayerResults) {
        geoElementsCountFromResult(identifyLayerResult);
    }
}

&lt;SPAN style="color: #808080;"&gt;/**
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; * Gets a count of the GeoElements in the passed result layer
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; *
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-weight: bold;"&gt;@param &lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;result from a single layer.
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-weight: bold;"&gt;@return &lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt;the total count of GeoElements.
&lt;/SPAN&gt;&lt;SPAN style="color: #808080;"&gt; */
&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;private void &lt;/SPAN&gt;geoElementsCountFromResult(IdentifyLayerResult result) {
    List&amp;lt;IdentifyLayerResult&amp;gt; tempResults = &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;ArrayList&amp;lt;&amp;gt;();
    tempResults.add(result);
    &lt;SPAN style="color: #000080; font-weight: bold;"&gt;int &lt;/SPAN&gt;index = &lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;;
    IdentifyLayerResult identifyResult = tempResults.get(index);
    &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(identifyResult.getSublayerResults().size() &amp;gt; &lt;SPAN style="color: #0000ff;"&gt;0&lt;/SPAN&gt;) {
        String siteName = Objects.requireNonNull(identifyResult.getSublayerResults().get(index).getElements().get(index).getAttributes().get(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"SiteName"&lt;/SPAN&gt;)).toString();
        String siteCode = Objects.requireNonNull(identifyResult.getSublayerResults().get(index).getElements().get(index).getAttributes().get(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"SiteCode"&lt;/SPAN&gt;)).toString();
        getMarkerPopUp(siteName, siteCode);
    }
}

In case of getting all data from sublayers of map, i am getting jsonEbeddedExcpetion.

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:22:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/esri-india-questions/how-to-get-data-from-all-sublayers-from/m-p/35374#M7</guid>
      <dc:creator>Puneetkumar</dc:creator>
      <dc:date>2021-12-10T21:22:44Z</dc:date>
    </item>
  </channel>
</rss>

