0

I'm developing a android application with arcgis sdk. I have a basemap and then 4 different feature layers on top of it. I began with the arcgis sample "attribute editor" and removed the edit functioncs because I just want to view the features of the clicked point.

I had a little issue with querying a point or a 1px line on the touchscreen but I solved it with creating an envelope around the clicked point and then query the envelope.

So far so good! But my problem now is, that I can only query one feature layer at a time. I want to click on the map and then it queryies the layer 1, layer 2, layer 3, and finally layer 4. How can you do this? I was just able to query layer 1 OR 2 OR 3 OR 4...

I have this code sections:

featureLayerDefault.selectFeatures(query,
ArcGISFeatureLayer.SELECTION_METHOD.NEW,
new CallbackListener<FeatureSet>() {
 // handle any errors
 public void onError(Throwable e) {
 Log.d(TAG, "Select Features Error" + e.getLocalizedMessage());
 }
if (queryResults.getGraphics().length > 0) {
Log.d(TAG, "Feature found id=" + queryResults.getGraphics()[0].getAttributeValue(featureLayerDefault.getObjectIdField()));
// set new data and notify adapter that data has changed
listAdapter.setFeatureSet(queryResults);
listAdapter.notifyDataSetChanged();
PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Oct 4, 2013 at 9:30

1 Answer 1

1

A QueryTask is the right approach for getting features from a single layer in a map service. If you want to query all layers in a map service you should use the IdentifyTask. Otherwise, you need to use multiple QueryTasks to query different layers.

answered Nov 15, 2013 at 4:54

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.