Using MapIt data
To use SQL Server tables via the MapIt Spatial Data Service in the ArcGIS API for WPF, you need to know the URL of a table. URLs can vary but will often look like the following for MapIt Spatial Data Service SQL Server tables:
http://www.example.com/sds/databases/Demo/dbo.WorldCities_Geographic
Using tables
In general, tables in SQL Server can be queried in the ArcGIS API for WPF and displayed as graphics in a map. MapIt components and SQL Server do not generate map images on a server; instead, the MapIt Spatial Data Service streams features (geometry and attributes) to the client, and the client is responsible for displaying the geographic content as graphics. The ArcGIS API for WPF includes the following core components you can use to access and display features:
- FeatureLayer—The easiest component to use when you want to display spatially enabled data tables via the Spatial Data Service. The Url property is required and must point to the table hosted by the Spatial Data Service. No code-behind is required. Symbology and renderers can be defined for the layer in XAML or code-behind.
- GraphicsLayer—Usually coupled with a QueryTask, which returns features that are programmatically added to the GraphicsLayer as graphic elements. The URL to the table hosted by the Spatial Data Service is defined on the QueryTask. A GraphicsLayer is often used when you need more explicit control over the structure of graphics in a layer or the properties of a layer. For example, the features and their attributes can be used to construct a class breaks renderer on-the-fly.
- QueryTask—Enables you to construct an attribute or spatial query to return records in a table hosted by the Spatial Data Service. The table may or may not be spatially enabled. If features are returned (thus geometry is returned) you can display them using a GraphicsLayer. The QueryTask provides a set of properties to refine the query results. You can obtain information about tables accessible from the MapIt Spatial Data Service from your MapIt/SQL Server administrator or by searching the MapIt Spatial Data Services Directory.