1

I have this service:

http://*************/ArcGIS/rest/services/mod_streets/MapServer

Layers:

Numbers (0)
StreetsGraph (1)
Streets (2)

And I'm trying to use only Numbers (note /0)

    map = (MapView) findViewById(R.id.map);
    ArcGISDynamicMapServiceLayer layerStreets = new ArcGISDynamicMapServiceLayer("http://*************/ArcGIS/rest/services/mod_streets/MapServer/0");
    map.addLayer(layerStreets);

This is not working.

But this works (removing /0 but all layers are displayed into the map)

    map = (MapView) findViewById(R.id.map);
    ArcGISDynamicMapServiceLayer layerStreets = new ArcGISDynamicMapServiceLayer("http://*************/ArcGIS/rest/services/mod_streets/MapServer");
    map.addLayer(layerStreets);

I want to see only Numbers in my Android map...Any ideas?

  • Did my code work ? – salihy Feb 16 '15 at 12:37
1

I think you can not use ArcGISDynamicMapServiceLayer for this issue. You should use ArcGISFeatureLayer instead. Sample code below.

String URL = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/0";
ArcGISFeatureLayer fLayer = new ArcGISFeatureLayer(URL, MODE.ONDEMAND);
map.addLayer(layerStreets);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.