<?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 Select features on feature layer in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/select-features-on-feature-layer/m-p/637494#M5662</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to select features on a AGSFeatureLayer, but that doesn't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's my code, maybe someone finds something that isn't right.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;code in "viewDidLoad". This adds the 18 AGSFeatureLayers to my mapView:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for(int i = 0; i &amp;lt; 19; i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSString *urlString = [@"http://www.geoportal.passau.de/ArcGIS/rest/services/APPDATEN/MapServer/" stringByAppendingFormat:@"%i", i];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSString *layerNameString = [@"feature" stringByAppendingFormat:@"%i", i];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSURL* url = [NSURL URLWithString: urlString];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSFeatureLayer* featureLayer = [AGSFeatureLayer featureServiceLayerWithURL: url mode: AGSFeatureLayerModeSelection];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.lyrView = [self.mapView addMapLayer:featureLayer withName:layerNameString];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayer.queryDelegate = self;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [self.featureLayerArray addObject:featureLayer];
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;code in "mapView: didLoadLayerForLayerView:". Here I'm trying to select a feature on the FeatureLayer number 1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;AGSFeatureLayer *newLayer = (AGSFeatureLayer*)[self.featureLayerArray objectAtIndex:1];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSQuery* query = [AGSQuery query];
&amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = @"ID &amp;lt;&amp;gt; 0";
&amp;nbsp;&amp;nbsp;&amp;nbsp; //query.spatialRelationship = AGSSpatialRelationshipWithin;
&amp;nbsp;&amp;nbsp;&amp;nbsp; //query.geometry = californiaGeometry;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [newLayer selectFeaturesWithQuery:query selectionMethod:AGSFeatureLayerSelectionMethodAdd];&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The class is defined as AGSFeatureLayerQueryDelegate, but none of these delegate methods is called:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;featureLayer: operation: didFailQueryFeaturesWithError:&lt;BR /&gt;featureLayer: operation: didFailSelectFeaturesWithError:&lt;BR /&gt;featureLayer: operation: didSelectFeaturesWithFeatureSet:&lt;BR /&gt;featureLayer: operation: didQueryFeaturesWithFeatureSet:&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;What am I doing wrong here? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there an example for that? I only found one with the editing of the FeatureLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any advice!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Philipp&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 03:05:45 GMT</pubDate>
    <dc:creator>PhilippFauser</dc:creator>
    <dc:date>2021-12-12T03:05:45Z</dc:date>
    <item>
      <title>Select features on feature layer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/select-features-on-feature-layer/m-p/637494#M5662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to select features on a AGSFeatureLayer, but that doesn't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's my code, maybe someone finds something that isn't right.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;code in "viewDidLoad". This adds the 18 AGSFeatureLayers to my mapView:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for(int i = 0; i &amp;lt; 19; i++) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSString *urlString = [@"http://www.geoportal.passau.de/ArcGIS/rest/services/APPDATEN/MapServer/" stringByAppendingFormat:@"%i", i];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSString *layerNameString = [@"feature" stringByAppendingFormat:@"%i", i];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSURL* url = [NSURL URLWithString: urlString];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSFeatureLayer* featureLayer = [AGSFeatureLayer featureServiceLayerWithURL: url mode: AGSFeatureLayerModeSelection];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.lyrView = [self.mapView addMapLayer:featureLayer withName:layerNameString];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayer.queryDelegate = self;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [self.featureLayerArray addObject:featureLayer];
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;code in "mapView: didLoadLayerForLayerView:". Here I'm trying to select a feature on the FeatureLayer number 1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;AGSFeatureLayer *newLayer = (AGSFeatureLayer*)[self.featureLayerArray objectAtIndex:1];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSQuery* query = [AGSQuery query];
&amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = @"ID &amp;lt;&amp;gt; 0";
&amp;nbsp;&amp;nbsp;&amp;nbsp; //query.spatialRelationship = AGSSpatialRelationshipWithin;
&amp;nbsp;&amp;nbsp;&amp;nbsp; //query.geometry = californiaGeometry;
&amp;nbsp;&amp;nbsp;&amp;nbsp; [newLayer selectFeaturesWithQuery:query selectionMethod:AGSFeatureLayerSelectionMethodAdd];&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The class is defined as AGSFeatureLayerQueryDelegate, but none of these delegate methods is called:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;featureLayer: operation: didFailQueryFeaturesWithError:&lt;BR /&gt;featureLayer: operation: didFailSelectFeaturesWithError:&lt;BR /&gt;featureLayer: operation: didSelectFeaturesWithFeatureSet:&lt;BR /&gt;featureLayer: operation: didQueryFeaturesWithFeatureSet:&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;What am I doing wrong here? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there an example for that? I only found one with the editing of the FeatureLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any advice!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Philipp&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:05:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/select-features-on-feature-layer/m-p/637494#M5662</guid>
      <dc:creator>PhilippFauser</dc:creator>
      <dc:date>2021-12-12T03:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Select features on feature layer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/select-features-on-feature-layer/m-p/637495#M5663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Okay, I think it's not working because I generate the AGSFeatureLayers in the for-loop and add them to the array.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I declare a public property for a AGSFeatureLayer in the header-file it's working (selecting the features).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way (I'm objective-c beginner, sometimes I don't get, maybe obvious, things...) to generate those 18 AGSFeatureLayers without declaring every single one as a property in the header-file?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Dec 2012 16:56:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/select-features-on-feature-layer/m-p/637495#M5663</guid>
      <dc:creator>PhilippFauser</dc:creator>
      <dc:date>2012-12-02T16:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Select features on feature layer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/select-features-on-feature-layer/m-p/637496#M5664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try changing code in your "mapView: didLoadLayerForLayerView:" as following...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if ([layerView.agsLayer isKindOfClass:[AGSFeatureLayer class]]) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSFeatureLayer *fl = (AGSFeatureLayer*)layerView.agsLayer;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fl.queryDelegate = self;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSQuery* query = [AGSQuery query];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = @"ID &amp;lt;&amp;gt; 0";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //query.spatialRelationship = AGSSpatialRelationshipWithin;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //query.geometry = californiaGeometry;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [fl selectFeaturesWithQuery:query selectionMethod:AGSFeatureLayerSelectionMethodAdd];
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nimesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:05:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/select-features-on-feature-layer/m-p/637496#M5664</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2021-12-12T03:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Select features on feature layer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/select-features-on-feature-layer/m-p/637497#M5665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nimesh,&lt;/P&gt;&lt;P&gt;Not able to get &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;didLoadLayerForLayerView: this method. Will you please help me with this.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2015 13:50:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/select-features-on-feature-layer/m-p/637497#M5665</guid>
      <dc:creator>HrishikeshPol</dc:creator>
      <dc:date>2015-01-29T13:50:25Z</dc:date>
    </item>
  </channel>
</rss>

