Select to view content in your preferred language

DynamicMapServiceLayer Labels - from Shapefile

5281
13
07-24-2014 05:52 AM
Labels (1)
LeeColclough
Deactivated User

I'm loading various shapefiles using ArcGIS for WPF and displaying them on a map (the mechanism for doing this is taken from the ArcGIS WPF runtime examples - see http://www.arcgis.com/home/item.html?id=953a530ada30477d95cc69e788268bc9).

I have a shapefile that contains Point information, and contained in it's attributes are the text labels that apply to those points. I cannot see how to access that information. I know the DBF file is being used as if I delete that file the shapefile will not render as it has no symbol information. Despite this, I cannot see when debugging the provided example how to access this information.

Obviously I could simply open the .dbf file manually but that seems awfully clunky. Does anyone have any help or pointers for me?

Many thanks in advance.

Lee.

0 Kudos
13 Replies
LeeColclough
Deactivated User

Thanks - any time you can spare is appreciated.  I expect I'm just missing something, but it's so easy to turn on the labels for ArcGISDynamicMapServiceLayer and seemingly impossible for ArcGISLocalDynamicMapServiceLayer - even when using very similar LayerDrawingOptions, that it just feels like a bug!

Thanks again.

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

This is not necessarily the answer, but it may be worth noting you do not really need to use ArcGISLocalDynamicMapServiceLayer. This class was just added to enable XAML support for local layers, by providing a Path property which will the API will then use internally to start a LocalMapService and hook up the Url property. Instead you can start a LocalMapService explicitly/programmatically and use the Url property directly with the ArcGISDynamicMapServiceLayer.

Cheers

Mike

0 Kudos
LeeColclough
Deactivated User

I changed the AddShapeFileAndRasterData WPF example to use a ArcGISDynamicMapServiceLayer instead of the Local variant, and hey presto - labels!

Well, that's my problem solved - thanks very much!  It was a very small change as that example creates the local map service programmatically anyway, I just needed to hook up the URL as you said.

Doesn't make a lot of sense that this doesn't work with the local variant, but I now have a way forward.  Thanks again.

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Well that is great news and I am very glad you can make progress again, but I will enter an issue to investigate this behavioural difference because it is unexpected.

Cheers

Mike

0 Kudos