I am learning ArcGIS javascript API and wanted to make a reordering panel for my webapp. I looked through the ArcGIS sample. http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/layers_dynamic_reorder.htmlsample.
but I'm stuck at addLake()addLake()
function. If I'm understand the sample correctly, to add the new lake layer
- get the existing DynamicLayerInfos from the current map
- create a new DynamicLayerInfo for the new layer
- push to the DynamicLayerInfos
- set the new DynamicLayerInfos to the map
1. get the existing DynamicLayerInfos from the current map
2. create a new DynamicLayerInfo for the new layer
3. push to the DynamicLayerInfos
4. set the new DynamicLayerInfos to the map
The example uses LayerDataSourceLayerDataSource
that reference a table as the new data source for the layer.
And how do you add a new layer from a public layer on a MapServer/FeatureServer. Can someone give me an example?