This topic provides information on how to bind the XamGeographicMap™ control to models that contain geographic data.
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/or geographic locations from data models on geographic imagery maps. The ItemsSource property of geographic series is used for the purpose of binding to data models. This property can be bound to any object that implements the IEnumerable interface (e.g. List, Collection, Queue, Stack). However, some types of geographic series require that each data item must have properties with specific data structures.
The following table summarized data structures required for each type of geographic series :
The following is a preview of the XamGeographicMap control with GeographicSymbolSeries bound to a data model that contains locations of some cities of the world.
The following code shows how to bind the GeographicSymbolSeries to a data model that contains geographic locations of some cities of the world stored using the PointList class .
In XAML:
<ig:XamGeographicMap.Series>
<ig:GeographicSymbolSeries LongitudeMemberPath="X"
LatitudeMemberPath="Y">
<ig:GeographicSymbolSeries.ItemsSource>
<ig:PointList>
<Point X="0.12" Y="51.50" x:Uid="London"/>
<Point X="37.51" Y="55.75" x:Uid="Moscow"/>
<Point X="151.2" Y="-33.83" x:Uid="Sedney"/>
<Point X="139.6917" Y="35.6895" x:Uid="Tokyo"/>
<Point X="77.2250" Y="28.6353" x:Uid="Delhi"/>
<Point X="-99.1276" Y="19.4270" x:Uid="MexicoCity"/>
<Point X="-73.9870" Y="40.7561" x:Uid="NewYork"/>
<Point X="-118.2434" Y="34.0522" x:Uid="LosAngeles"/>
<Point X="-46.6388" Y="-23.5489" x:Uid="SaoPaulo"/>
</ig:PointList>
</ig:GeographicSymbolSeries.ItemsSource>
</ig:GeographicSymbolSeries>
</ig:XamGeographicMap.Series>
In Visual Basic:
Dim series = New GeographicSymbolSeries()
series.LongitudeMemberPath="X"
series.LatitudeMemberPath="Y"
Dim geoLocations = New Infragistics.Controls.Charts.PointList()
geoLocations.Add(New Point() With { .X = 0.12, .Y = 51.5 })
geoLocations.Add(New Point() With { .X = 37.51, .Y = 55.75 })
geoLocations.Add(New Point() With { .X = 151.2, .Y = -33.83 })
geoLocations.Add(New Point() With { .X = 139.6917, .Y = 35.6895 })
geoLocations.Add(New Point() With { .X = 77.225, .Y = 28.6353 })
geoLocations.Add(New Point() With { .X = -99.1276, .Y = 19.427 })
geoLocations.Add(New Point() With { .X = -73.987, .Y = 40.7561 })
geoLocations.Add(New Point() With { .X = -118.2434, .Y = 34.0522 })
geoLocations.Add(New Point() With { .X = -46.6388, .Y = -23.5489 })
series.ItemsSource = geoLocations
Me.GeoMap.Series.Add(series)
In C#:
var series = new GeographicSymbolSeries();
series.LongitudeMemberPath="X";
series.LatitudeMemberPath="Y";
var geoLocations = new Infragistics.Controls.Charts.PointList();
geoLocations.Add(new Point() { X = 0.12, Y = 51.50 });
geoLocations.Add(new Point() { X = 37.51, Y = 55.75 });
geoLocations.Add(new Point() { X = 151.2, Y = -33.83 });
geoLocations.Add(new Point() { X = 139.6917, Y = 35.6895 });
geoLocations.Add(new Point() { X = 77.2250, Y = 28.6353 });
geoLocations.Add(new Point() { X = -99.1276, Y = 19.4270 });
geoLocations.Add(new Point() { X = -73.9870, Y = 40.7561 });
geoLocations.Add(new Point() { X = -118.2434, Y = 34.0522 });
geoLocations.Add(new Point() { X = -46.6388, Y = -23.5489 });
series.ItemsSource = geoLocations;
this.GeoMap.Series.Add(series);
The following topics provide additional information related to this topic.