Select to view content in your preferred language

Feature layer from json

526
0
07-02-2013 11:21 PM
NigelDsouza
Frequent Contributor
Hi I have been given a URL which gives the data in json format. The result is showing me four layers(3 polygon layers and 1 point layer). My main aim is to display the features on the map and be able to query them.
Currently I am using a JSON task, getting a json object , looping through all the features and storing them in graphics, adding them to a graphicLayer and displaying them.
My question is,
1. If i have to query for any feature or attribute then what kind of layer do I need to create from the data?
2. I am getting a featureSet through the following:
  var myFeatureSet:FeatureSet = new FeatureSet(layers.featureCollection.layers.featureSet.features);

3. But how to i get the layer details? I am using this line for now but it doesnt work..
var myLayerDetails:LayerDetails =  layers.featureCollection.layers.layerDefinition;
Tags (2)
0 Kudos
0 Replies