0

I am using a Map Service from http://watersgeo.epa.gov/arcgis/rest/services/NHDPlus_NP21/WBD_NP21_Simplified/MapServer/. It offers multiple layers and its a great resource.

I'm wondering if its possible to access or create features layers from this service? In the end, I'd like to shade the watersheds according to differing data values similar to the example at https://developers.arcgis.com/javascript/jssamples/styling_svg_fb.html.

From what I'm reading at https://developers.arcgis.com/javascript/jshelp/inside_feature_layers.html, it seems like Service Layers just do not provide all the fun vector information that Feature Layers do. So, even if I can't get access to the color of the different shapes, can I at least get the gps coordinates so I can draw new polygons to work with?

2 Answers 2

1

You can access the features of the service by adding one of the service's layers as a feature layer to the map. See:

http://jsfiddle.net/a0heum8w/

From there, you should be able to use a renderer to control the symbols used to draw the polygons:

https://developers.arcgis.com/javascript/jssamples/#search/renderer

5
  • Thanks for the help! I've got it switched to a feature layer but I'm still having issues using the renderer. I guess it's not as easy as switching out the feature layer and the class breaks. Do you have a any specific and simple examples that use this method?
    – daniella
    Commented Aug 25, 2014 at 20:35
  • I still don't know which of the service's layers nor which kind of renderer (class breaks?) you are trying to use. I'ts probably easiest if you can put the sample code that you modified somewhere (JS fiddle/bin) so we can see it.
    – Tom Wayson
    Commented Aug 26, 2014 at 21:30
  • I've got this fiddle jsfiddle.net/a0heum8w/3
    – daniella
    Commented Aug 27, 2014 at 15:24
  • Sorry for the delayed response. I've been on vacation. I had trouble getting your fiddle working (saw one error, map id is "mapDiv", not "map", but didn't work after that fix). Instead, I added your renderer to my fiddle. Seems to work: jsfiddle.net/tomwayson/5tc10Lfo
    – Tom Wayson
    Commented Sep 2, 2014 at 5:36
  • Wow! that's looks great! Thanks! I will also be busy the next couple of weeks so when I get back, I'll have to mess with it a bit. Thanks again!
    – daniella
    Commented Sep 2, 2014 at 18:56
0

In theory you could use the supported Query interface on this Service Layer to download the geometries: http://watersgeo.epa.gov/arcgis/rest/services/NHDPlus_NP21/WBD_NP21_Simplified/MapServer/0/query

But this seems like it might not be the best idea.

Following the full metadata link (http://www.horizon-systems.com/nhdplus/NHDPlusV2_home.php) you can get to a download page (http://www.horizon-systems.com/NHDPlus/V2NationalData.php). That seems easier than recreating the layer from a Service Layer.

Your Answer

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

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