@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //Feature layer service //Read Feature Layer first, but invisible with no "SELECTION" featureLayer = new ArcGISFeatureLayer(this .getResources().getString(R.string.featurelayer_url), ArcGISFeatureLayer.MODE.SELECTION); //Here, I do not specify SimpleMarkerSymbol as I want to use default one. [STEP1] //query featureLayer with parameter featureLayer.selectFeatures(query_fl, ArcGISFeatureLayer.SELECTION_METHOD.NEW,callback); mMapView.addLayer(featureLayer); // start default tap actions // singleTap on map causes an Identify setDefaultTapActions(); } public void setDefaultTapActions(){ mMapView.setOnSingleTapListener(new OnSingleTapListener() { @Override public void onSingleTap(float x, float y) { ...... //set symbol for selected featureLayer for Default Single Tap [Transparent]: [STEP2] SimpleMarkerSymbol SelectionSymbol = new SimpleMarkerSymbol(Color.TRANSPARENT, 6, SimpleMarkerSymbol.STYLE.CIRCLE); featureLayer.setSelectionSymbol(SelectionSymbol); featureLayer.selectFeatures(query, ArcGISFeatureLayer.SELECTION_METHOD.NEW, new CallbackListener<FeatureSet>(){ //@Override //handle any errors public void onError(Throwable e) { Log.d(TAG, "Select Features Error" + e.getLocalizedMessage()); } //@Override // public void onCallback(FeatureSet queryResults) { if(queryResults.getGraphics().length > 0){ //show the points again //execute the second query with the OwnerID Query query_fl_again = new Query(); query_fl_again. ...... //clear selection once featureLayer.clear(); // set symbol for selected featureLayer [STEP3] SimpleMarkerSymbol SelectionSymbol = new SimpleMarkerSymbol(Color.TRANSPARENT, 6, SimpleMarkerSymbol.STYLE.CIRCLE); SimpleLineSymbol SlectionOutline = new SimpleLineSymbol(Color.CYAN, 2, SimpleLineSymbol.STYLE.SOLID); SelectionSymbol.setOutline(SlectionOutline); featureLayer.setSelectionSymbol(SlectionOutline); featureLayer.selectFeatures(query_fl_again, ArcGISFeatureLayer.SELECTION_METHOD.NEW,callback); mMapView.addLayer(featureLayer); return; }
Solved! Go to Solution.