I want to access one layer of a map service to show it in a list. I do not want to add it as a layer using /MapServer/0 in config.xml because then I lose the dynamic display properties that the /MapServer provides. (The layer has 100,000 features so it blows up as a feature layer.)
Can I get at it in a Map Service or is there a way to add a just layer in config.xml that is dynamic display wise?
Have tried many things.
One was to publish a new map service each time but then there are so many map services the server bogs.
In the end all I want to do it be able to list layers multiple times, in multiple places, without having to create another Map Service all the time. In other words granular control over how and where layers (not whole maps) are listed while still keeping the dynamic display properties).
Concept: Kinda like ArcGIS Online where I am building a map up from multiple layers, each of which may be in a different map service.
Any ideas would be very appreciated, this has been struggled with for some time.
It looks like on demand mode just limits the features to the current extent. The problem is all of these are national layers and I am sure people will turn them on at the national (US) scale often. Zoomed in they are not that slow but full extent the browser can not even load all 100K features.
There must be a way because you can make just one layer of a map visible. I am going to look into how the checkbox makes just one layer of the map visible.
Thanks this is really close. Is this available in AS? The mxml seems static.
I am thinking I would make the TOC just like in ArcMap. So I start with a empty TOC and Map (do not let the code load in the layers from the config.xml). Then when the user clicks on a layer name (which is a sublayer) I then tell the TOC/Map to add that sub layer.
In other words the user click tells TOC to go ahead and load sublayer 0 of map service X. (But do not load (or just not show) in the TOC say sublayer 1 of map service X)
But did you have a look at it because this does something similar to what you are trying, it allows you to add / remove layers after the application has loaded (these can be individual feature layers from a map service if required).
I looked at it briefly but I wanted a different UI. Then when i hit the just one layer of a map service issue I had looked at so much stuff I forgot about it.
Looks promising. But the issue I see is that it loads feature layers as /FeatureServer/0 but then they are not dynamically rendered like they are with /MapServer (at least if you say MapServer/0 they are not since they you have to say type feature not dynamic).
I need to show one layer (sublayer) out of a MapServer in the TOC. So tell it - in this Map Service just put this sublayer in the TOC. Some of our Map Service have 190+ layers and I just want one of those - and since it has 103K polygons it needs to be dynamic.
Sure anything you can do in MXML you can do in AS (as all MXML actually gets turned into AS when compiled). For the visibleLayers all you do is hand it a array of layer IDs that you want visible.