Select to view content in your preferred language

Loading individual rasters in mapcontrol

985
4
04-07-2011 11:29 PM
SteveVidal
Emerging Contributor
I get an error when I try to add a raster layer to a mapcontrol layers collection using the FeatureLayer(url) where url points to a single layer.

I can add the raster using the ArcGISDynamicMapServiceLayer and passing the url of the service, but then I get all the layers.

In my scenario I have one service with multiple layers (all rasters) and I want to load one layer (i.e. raster) at a time.

Any ideas?

btw, adding a layer at a time works fine for standard geometries (point,line,polygon), just not for rasters.
0 Kudos
4 Replies
DominiqueBroux
Esri Frequent Contributor
The FeatureLayers doesn't support raster.

You can use an ArcGISDynamicMapServiceLayer  and set the VisibleLayers property to the layer you want to keep.
0 Kudos
SteveVidal
Emerging Contributor
Hi Dominique,

>You can use an ArcGISDynamicMapServiceLayer and set the VisibleLayers property to the layer you want to keep.

Thanks, that's my fallback scenario. I just wasn't sure whether the non-visible layers would also get downloaded since I can only set this property in the initialize event (i.e. for the ArcGISDynamicMapServiceLayer). Can you please confirm that this is the case?

>The FeatureLayers doesn't support raster.

What about charts? Are these supported? Also, are raster going to be supported in the next release? (something like RasterLayer would be nice).

Thanks again for the feedback.
0 Kudos
DominiqueBroux
Esri Frequent Contributor

Thanks, that's my fallback scenario. I just wasn't sure whether the non-visible layers would also get downloaded since I can only set this property in the initialize event

The non visible layers are not downloaded at first. But as soon as you set a layer as visible, this layer will get downloaded (with a dynamicmapservice you get an image at each zoom or pan).




What about charts? Are these supported?

You can't reuse the chart defined with ArcGIS desktop but you can redefine your charts at the client side by using the Silverlight charting tools (sample)

Also, are raster going to be supported in the next release?

I am not aware of any plan to support raster inside a feature layer. Today images are already supported by ArcGISDynamicMapService and by ImageServices (see sample)
0 Kudos
SteveVidal
Emerging Contributor
Thanks again, Dominique.

I am not aware of any plan to support raster inside a feature layer. Today images are already supported by ArcGISDynamicMapService and by ImageServices (see sample)


I was thinking about a new type (e.g. RasterLayer) with no editing functionality, rather than adding raster support to the existing feature layer.
0 Kudos