This topic provides information on how to add the XamGeographicMap™ control to an application page.
The following table lists the topics required as a prerequisite to understanding this topic.
This topic contains the following sections
The XamGeographicMap control is designed to display geo-spatial data from shape files and geographic locations from view models on geographic imagery maps. However, this topic focuses on adding the XamGeographicMap control with the minimum code and property settings required for display. By default the XamGeographicMap control is displayed with geographic imagery tiles from Open Street Map service.
The following is a preview of the XamGeographicMap control with geographic imagery tiles from Open Street Map service.
The following table summarizes the requirements for adding the XamGeographicMap control.
The following is a conceptual overview of the process:
Reference Infragistics assemblies in your project
Add Infragistics namespaces to your application’s view
Add the Geographic Map control to your application’s view
Verify the results
The following procedure takes you step-by-step toward adding the XamGeographicMap control to a page.
Add the following Infragistics NuGet package to your application:
Infragistics.WPF.GeographicMap
For more information on setting up the NuGet feed and adding NuGet packages, you can take a look at the following documentation: NuGet Feeds.
In the application page, add the following namespace declarations:
In XAML:
xmlns:ig="http://schemas.infragistics.com/xaml"
In Visual Basic:
Imports Infragistics.Controls.Maps
In C#:
using Infragistics.Controls.Maps;
The following code demonstrates adding the XamGeographicMap control with the minimum code and property settings required for display:
In XAML:
<Grid x:Name="LayoutRoot">
<ig:XamGeographicMap x:Name="GeoMap" />
</Grid>
In Visual Basic:
Dim geoMap As New XamGeographicMap()
Me.LayoutRoot.Children.Add(geoMap)
In C#:
var geoMap = new XamGeographicMap();
this.LayoutRoot.Children.Add(geoMap);
Build and run your project to verify the result. If you have implemented the steps correctly, the displayed XamGeographicMap should look like the one in the Preview section above.
The following topics provide additional information related to this topic.