0

I am creating a webmap from JSON using esri utils.createMap. My question is that I have a single layer that actually contains separate information within in, in this case it contains bike paths, hiking trails, sidewalks, etc. The map simply shows them all at once. I was wondering if there was a way to split the individual paths up within the JSON implementation so that they are all there "own" operational layer... here is the code for that layer...

"url": "http://../mymapserver/8",
            "visibility": false,
            "opcaity": 0.85,
            "title": "Trails",
            "visibleLayers": 1,
            "layerDefinition": {
                "minScale": 0
            }

Thanks!

griggsbe
  • 13
  • 4
  • 2) What type of service are you using? If it's a DynamicMapService, have a look at [setLayerDefinitions](http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/arcgisdynamicmapservicelayer.html#setLayerDefinitions). You may be able to add the layer multiple times, and filter it for each type of path based on the field values (I'm assuming there's a field that tells you "this is a bike path", "this is a trail" etc) – Juffy Apr 03 '13 at 02:30

1 Answers1

0

Since the setLayerDefinitions did not work for me I found a different solution. I created individual featureLayers using JSON and added them to the map after the initial map creation.

Thanks.

griggsbe
  • 13
  • 4