Select to view content in your preferred language

Select queried features

2620
3
Jump to solution
11-06-2015 01:10 PM
HaniDraidi
Frequent Contributor

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
Honored Contributor

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
Frequent Contributor

@Eric Bader

@Mengyi Guo

0 Kudos
EricBader
Honored Contributor

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
Frequent Contributor

Thank you Eric,

I tried this and it worked Great!