<?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 use setLayerDefs method for IdentifyParameters? in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-use-setlayerdefs-method-for/m-p/139650#M1040</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;According to &lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/core/tasks/identify/IdentifyParameters.html#setLayerDefs(java.util.Map&amp;lt;java.lang.String, java.lang.String&amp;gt;)"&gt;Arcgis Android API&lt;/A&gt;, we can use setLayerDefs method in IdentifyParameters class to filter features of individual layers.&lt;/P&gt;&lt;P&gt;The method is &lt;STRONG&gt;p&lt;SPAN class="normal" style="font-size: 0.9em;"&gt;ublic void &lt;/SPAN&gt;&lt;SPAN class="sympad" style="margin-right: 2px;"&gt;setLayerDefs&lt;/SPAN&gt; &lt;SPAN class="normal" style="font-size: 0.9em;"&gt;(Map&amp;lt;&lt;SPAN style="color: #7ed529;"&gt;String&lt;/SPAN&gt;, String&amp;gt; layerDefs)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="normal" style="font-size: 0.9em; font-weight: normal;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;However the method use in ArcGISDynamicMapServiceLayer class is different; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;public void &lt;SPAN class="sympad" style="margin-right: 2px; color: #303030; font-family: arial, sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;&lt;SPAN&gt;setLayerDefinitions&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;(Map&amp;lt;&lt;SPAN style="color: #7ed529;"&gt;Integer&lt;/SPAN&gt;, String&amp;gt; layerDefs)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;The different is the key; one accepts String and the other accepts Integer. My question is what value for key String? Is it the identify task url? Or null?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;Below is a snippet of the code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14128258374613921" jivemacro_uid="_14128258374613921" modifiedtitle="true"&gt;
&lt;P&gt;String q = "STATE LIKE 'ta%'";&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;HashMap&amp;lt;String,String&amp;gt; layerDefsIdentify = new HashMap&amp;lt;String,String&amp;gt;();&lt;/P&gt;
&lt;P&gt;layerDefsIdentify.put(WHAT_IS_HERE,q);// I don't know&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//Set Identify Parameters&lt;/P&gt;
&lt;P&gt;params = new IdentifyParameters();&lt;/P&gt;
&lt;P&gt;params.setTolerance(15);&lt;/P&gt;
&lt;P&gt;params.setDPI(98);&lt;/P&gt;
&lt;P&gt;params.setLayers(new int[]{0});&lt;/P&gt;
&lt;P&gt;params.setLayerMode(IdentifyParameters.VISIBLE_LAYERS);&lt;/P&gt;
&lt;P&gt;params.setLayerDefs(&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;layerDefsIdentify&lt;/SPAN&gt;); //calling the method here.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-size: 12px; background-color: #f6f6f6; font-family: arial, sans-serif;"&gt;I would really appreciate it if someone could help me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-size: 12px; background-color: #f6f6f6; font-family: arial, sans-serif;"&gt;Thanks&lt;/SPAN&gt;-lolobs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Oct 2014 03:52:27 GMT</pubDate>
    <dc:creator>azzamwahab</dc:creator>
    <dc:date>2014-10-09T03:52:27Z</dc:date>
    <item>
      <title>How to use setLayerDefs method for IdentifyParameters?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-use-setlayerdefs-method-for/m-p/139650#M1040</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;According to &lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/core/tasks/identify/IdentifyParameters.html#setLayerDefs(java.util.Map&amp;lt;java.lang.String, java.lang.String&amp;gt;)"&gt;Arcgis Android API&lt;/A&gt;, we can use setLayerDefs method in IdentifyParameters class to filter features of individual layers.&lt;/P&gt;&lt;P&gt;The method is &lt;STRONG&gt;p&lt;SPAN class="normal" style="font-size: 0.9em;"&gt;ublic void &lt;/SPAN&gt;&lt;SPAN class="sympad" style="margin-right: 2px;"&gt;setLayerDefs&lt;/SPAN&gt; &lt;SPAN class="normal" style="font-size: 0.9em;"&gt;(Map&amp;lt;&lt;SPAN style="color: #7ed529;"&gt;String&lt;/SPAN&gt;, String&amp;gt; layerDefs)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="normal" style="font-size: 0.9em; font-weight: normal;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;However the method use in ArcGISDynamicMapServiceLayer class is different; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;public void &lt;SPAN class="sympad" style="margin-right: 2px; color: #303030; font-family: arial, sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;&lt;SPAN&gt;setLayerDefinitions&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;(Map&amp;lt;&lt;SPAN style="color: #7ed529;"&gt;Integer&lt;/SPAN&gt;, String&amp;gt; layerDefs)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;The different is the key; one accepts String and the other accepts Integer. My question is what value for key String? Is it the identify task url? Or null?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;Below is a snippet of the code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14128258374613921" jivemacro_uid="_14128258374613921" modifiedtitle="true"&gt;
&lt;P&gt;String q = "STATE LIKE 'ta%'";&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;HashMap&amp;lt;String,String&amp;gt; layerDefsIdentify = new HashMap&amp;lt;String,String&amp;gt;();&lt;/P&gt;
&lt;P&gt;layerDefsIdentify.put(WHAT_IS_HERE,q);// I don't know&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//Set Identify Parameters&lt;/P&gt;
&lt;P&gt;params = new IdentifyParameters();&lt;/P&gt;
&lt;P&gt;params.setTolerance(15);&lt;/P&gt;
&lt;P&gt;params.setDPI(98);&lt;/P&gt;
&lt;P&gt;params.setLayers(new int[]{0});&lt;/P&gt;
&lt;P&gt;params.setLayerMode(IdentifyParameters.VISIBLE_LAYERS);&lt;/P&gt;
&lt;P&gt;params.setLayerDefs(&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;layerDefsIdentify&lt;/SPAN&gt;); //calling the method here.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-size: 12px; background-color: #f6f6f6; font-family: arial, sans-serif;"&gt;I would really appreciate it if someone could help me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030; font-size: 12px; background-color: #f6f6f6; font-family: arial, sans-serif;"&gt;Thanks&lt;/SPAN&gt;-lolobs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 03:52:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-use-setlayerdefs-method-for/m-p/139650#M1040</guid>
      <dc:creator>azzamwahab</dc:creator>
      <dc:date>2014-10-09T03:52:27Z</dc:date>
    </item>
  </channel>
</rss>

