How do we display labels from Map Docment in Flex Viewer??

3227
11
Jump to solution
01-19-2012 12:03 PM
MichaelMiller2
Occasional Contributor III
We have a bunch of scale dependent highway shield labels we have set up in the Map Document that we would like to display using the map service in the Flex Viewer 2.5. They do not display when the map service instance is added to the Flex Viewer.  I've tried converting the labels to annotation, but that does not appear to be working either.  Is this possible?

Any help or direction is greatly appreciated.

Michael Miller
Tags (2)
0 Kudos
11 Replies
CollinHorace
New Contributor II
Ok, let's start simple. The "dynamic" layer "Anno" is actually my parcel dimension annotation class. Basically, if I was to remove that annotation layer from my service. How do I get labeling to show on my feature layers? Do I need to change them all to dynamic? I have also been publishing from the mxd. Can you provide a simple code example?
0 Kudos
RhettZufelt
MVP Frequent Contributor
Ok, say you load your parcel feature class into a new mxd.

then, you can get properties, go to labeling tab and select the "Label Features in this layer" checkbox.
select the field you want to label from (I assume you have a dimensions field as as an attribute in the parcels FC?), set up fonts, etc, Scale range and whatever you want.  (If your parcel dimensions are not a field in the parcel FC, then this doesn't apply.)

Then publish as a service.  If you load this service into FV as type="dynamic", when ever you turn on the parcel layer (check the checkbox), the labels should show also (as long as the scale range, etc. has been met) and there isn't a need for an annotation layer.  If you can't live with the label placement and such, then an anno layer is best choice.

Everything I have mentioned is done in ArcMap, and there is no "code example" for such.

R_

Also, are you sure you need to load all the sublayers as type feature rather than just loading the entire thing as dynamic?  you mention you need type="feature" for certain tools like search.
Search requires you to put in the url to the actual sublayer anyway (which points to a feature type), and will search it just fine, even if that layer is NOT loaded in the map. So, for the search tool anyway, what you search and what you see can be two completely differnt layers.


So

<layer label="Tax Information" url="http://weba.co.clayton.ga.us/arcgis/rest/services/TaxInformation/MapServer" type="dynamic" alpha="1" visible="true"/>
in the config.xml

and

   <name>Parcels</name>
   <url>http://weba.co.clayton.ga.us/arcgis/rest/services/TaxInformation/MapServer/8</url>
   <expressions>


in the searchWidget.xml will display ALL the layers in the service, but will only search the sublayerid=8 (asssuming that the parcels layer is in the TaxInformation/MapServer/8.

I see on a couple that you have the AttRelateInfoWinWidget referenced, and this one does require type="feature".  what are you using this widget for?  perhaps there is another utility that will get you what you need with type="dynamic"?

Also, not sure how these widgets work on a FeatureServer layer as I never used them as I don't do editing with Flex.  For AttRelateInfoWinWidget to work, can publish as a MapServer layer and just specify as type="feature" and does not actually have to be published as a FeatureServer.

I just gave that a try. The anno layer is only turned on, with all of the other layers off. However, I still have missing symbology and labels.


If you have the anno layer "ON", you should see the labels.  If not, do you see them in the mxd?
0 Kudos