queryTask sample

821
1
02-26-2017 12:10 AM
mahshidfallah1
New Contributor

Hi,In querytask sample i have a problem.when i search a place it can found it but cant change color of feature.

i use 'ArcGISDynamicMapServiceLaye' 

for load map.and when search data change feature in this map.this is my code:

addText = false;
queryLayer = "http://192.168.10.1:6080/arcgis/rest/services/Babolsar/Babolsar/MapServer";

map = (MapView) findViewById(R.id.map);
ArcGISDynamicMapServiceLayer tms = new ArcGISDynamicMapServiceLayer("http://192.168.10.1:6080/arcgis/rest/services/Babolsar/Babolsar/MapServer");
map.addLayer(tms);

Options o = new Options();
o.mode = MODE.ONDEMAND;
o.outFields = new String[]{"OBJECTID"};
fLayer = new ArcGISFeatureLayer("http://192.168.10.1:6080/arcgis/rest/services/Babolsar/Babolsar/MapServer/10", o);

SimpleFillSymbol fiedldsSelectionSymbol = new SimpleFillSymbol(Color.MAGENTA);
fiedldsSelectionSymbol.setOutline(new SimpleLineSymbol(Color.YELLOW, 2));
fLayer.setSelectionSymbol(fiedldsSelectionSymbol);
map.addLayer(fLayer);



map.setOnStatusChangedListener(new OnStatusChangedListener() {

    private static final long serialVersionUID = 1L;

    @Override
    public void onStatusChanged(Object source, STATUS status) {

        if (source == map && status == STATUS.INITIALIZED) {

            graphicsLayer = new GraphicsLayer();
            SimpleRenderer sr = new SimpleRenderer(
                    new SimpleFillSymbol(Color.RED));
            graphicsLayer.setRenderer(sr);
            map.addLayer(graphicsLayer);

        }
    }
});




Tags (2)
Reply
0 Kudos
1 Reply
mahshidfallah1
New Contributor

please help me friends

Reply
0 Kudos