Select to view content in your preferred language

Silverlight API to turn on/off labels in a ArcGIS Server dynamic map service layer?

3315
1
Jump to solution
03-30-2012 08:39 AM
SuiHuang
Frequent Contributor
Hi Experts:

    I am writting a Silverlight application to display a map from an ArcGIS Server dynamic map service.
   
    some feature layers in the map service have labels and currently we can only turn the labels on/off directly in the MXD file that underlies the map service. In the running Silverlight application, we can currently only allow user to turn the whole layer (including polygons and labels) on/off. Is there any way to allow our user turn on/off the label only, without impacting the display of the polygons?

    I understand that there is an alternative way: for the same layer we can make two references in MXD file. One reference displays polygons only, while the other displays labels and transparent polygons. However, there are drawback on this approach. The MXD file can become much harder to maintain, and the Silverlight code will have significant complexity increase in our design.

    Is there any other method?

    Thank you.

Sui
0 Kudos
1 Solution

Accepted Solutions
wangzhifang
Frequent Contributor
There is no control ability on label in REST API(as far as I know, neither 10.1 rest api).
So you can just turn off the visibility of a whole layer rather than labels only.
Two solutions to this issue:
1. Maintain two map services on server, one for map content only and another for "labels" only. On client side, you can easily switch the visibility of each layer(the label map service or the map content map service). On server side, construct the "labels" only map service by creating a annotation feature class, and only add this layer to your mxd, then publish. This is the recommended approach and indeed implemented by online maps provider, such as ArcGIS Online or ???????.
2. Turn off your label in mxd and implemented label function on client side by using graphics layer and text symbol.

Hope these helps.

View solution in original post

0 Kudos
1 Reply
wangzhifang
Frequent Contributor
There is no control ability on label in REST API(as far as I know, neither 10.1 rest api).
So you can just turn off the visibility of a whole layer rather than labels only.
Two solutions to this issue:
1. Maintain two map services on server, one for map content only and another for "labels" only. On client side, you can easily switch the visibility of each layer(the label map service or the map content map service). On server side, construct the "labels" only map service by creating a annotation feature class, and only add this layer to your mxd, then publish. This is the recommended approach and indeed implemented by online maps provider, such as ArcGIS Online or ???????.
2. Turn off your label in mxd and implemented label function on client side by using graphics layer and text symbol.

Hope these helps.
0 Kudos