Select to view content in your preferred language

Joining Database with Map Layer

4056
12
01-07-2013 06:53 AM
GeorgeFaraj
Frequent Contributor
Hello,

I have a database table (MSSQL) that contains additional information about my layer's features. I want to be able to show this information as part of the layer's map tip. The layer contains an ID attribute that links each feature to a record in the table. Can someone direct me towards achieving this?

PS. I assume map tips are the only way to display information in the map about features, since I haven't found any info about traditional labeling anywhere. I would prefer labeling within the features, so if anyone has any information about that, I'd appreciate it as well.

Thanks!
0 Kudos
12 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

The DynamicLayer capability is only supported on the MapServer, but in order to introduce more advanced labelling behaviour, you will need the MapServer to be rendering at least the labels, if not the entire layer (e.g. if used in conjunction with a selection only feature layer). There's only one property to enable labelling when working with the LayerDrawingOptions class (http://resources.arcgis.com/en/help/runtime-wpf/apiref/index.html?ESRI.ArcGIS.Client~ESRI.ArcGIS.Cli...), but these labels should exhibit better rendering behavior than just using TextSymbols via the API.

As i said - we're aware of the limited labelling capabilities for graphics in the map and are working on improving this functionality for a future release.

Cheers

Mike
0 Kudos
GeorgeFaraj
Frequent Contributor
Hey Mike,

We are thinking of using LabelPoints/TextSymbols and make them look better manually, because setting up the labels in ArcMap is not a viable option for us right now. That said, is there a way to set a JoinDataSource on a FeatureLayer, so that I can use the extra fields from the database in the TextSymbol?

Also, how would I register a workspace for my database?
0 Kudos
MichaelBranscomb
Esri Frequent Contributor

We are thinking of using LabelPoints/TextSymbols and make them look better manually, because setting up the labels in ArcMap is not a viable option for us right now. That said, is there a way to set a JoinDataSource on a FeatureLayer, so that I can use the extra fields from the database in the TextSymbol?


The DynamicLayers capability is unfortunately not available on the FeatureServer and therefore on the FeatureLayer class, it's only available on the MapServer and the ArcGIS[Local]DynamicMapServiceLayer class.


Also, how would I register a workspace for my database?


You register workspaces with the LocalMapService prior to starting it - however looking at the documentation again the database needs to be a geodatabase. There is a sample on ArcGIS.com (http://www.arcgis.com/home/item.html?id=953a530ada30477d95cc69e788268bc9) which demonstrates using the DynamicLayers capability for adding folder workspaces (shapefile/raster) and redefining the layers within a local map service, although it does not demonstrate table joins. This sample is included with the SDK Sample Application in the next release (10.1.1).


Cheers

Mike
0 Kudos