Select queried features

2470
3
Jump to solution
11-06-2015 01:10 PM
HaniDraidi
Occasional Contributor II

I am trying to build an app that queries some features, I wrote the query, but I am not able to select the queried features.

The query works well, and I can confirm that by the toast that says "found 10 features" by the showtoast() function. However I am not able to select these feature and highlight them in the layer.

Any suggestion about how I can select the resultant features?

Any help is highly appreciated!

Hani

0 Kudos
1 Solution

Accepted Solutions
EricBader
Occasional Contributor III

Hi Hani,

Have you looked at the sample that selects features and highlights them: Query Feature Service Table | ArcGIS for Developers ?

Once your query completes, is your code doing something like the following?:

// Iterate the results and select each feature.

for (Object objFeature : objs){

    Feature feature = (Feature) objFeature;

    featureLayer.selectFeature(feature.getId());

}

View solution in original post

3 Replies
HaniDraidi
Occasional Contributor II

@Eric Bader

@Mengyi Guo

0 Kudos
EricBader
Occasional Contributor III

Hi Hani,

Have you looked at the sample that selects features and highlights them: Query Feature Service Table | ArcGIS for Developers ?

Once your query completes, is your code doing something like the following?:

// Iterate the results and select each feature.

for (Object objFeature : objs){

    Feature feature = (Feature) objFeature;

    featureLayer.selectFeature(feature.getId());

}

HaniDraidi
Occasional Contributor II

Thank you Eric,

I tried this and it worked Great!