This topic provides information on how to use the GeographicSymbolSeries element in the XamGeographicMap™ control.
The following table lists the topics required as a prerequisite to understanding this topic.
This topic contains the following sections:
In the XamGeographicMap control, the GeographicSymbolSeries is a visual map element that displays geo-spatial data using points or markers in a geographic context. This type of geographic series is often used to render a collection of geographic locations such as cities, airports, earthquakes, or points of interests.
The following is a preview of the XamGeographicMap control with GeographicSymbolSeries plotting locations of major cities in the world.
Similarly to other types of geographic series in the XamGeographicMap control, the GeographicSymbolSeries has the ItemsSource property for the purpose of data binding. This property can be bound to an object that implements the IEnumerable interface (e.g. List, Collection, Queue, Stack). In addition, each item in this object must have two numeric data columns that store a geographic location (longitude and latitude). These data columns are then mapped to the LatitudeMemberPath and LongitudeMemberPath properties. The GeographicSymbolSeries uses values of these mapped data columns to plot symbol elements in the XamGeographicMap control.
The following code shows how to bind the GeographicSymbolSeries to locations of cities loaded from a shape file using the ShapefileConverter.
In XAML:
<ig:ShapefileConverter x:Key="shapefileConverter"
ShapefileSource="ShapeFiles/world_cities.shp"
DatabaseSource="ShapeFiles/world_cities.dbf" >
</ig:ShapefileConverter>
<ig:XamGeographicMap x:Name="GeoMap">
<ig:XamGeographicMap.Series>
<ig:GeographicSymbolSeries ItemsSource="{StaticResource shapefileConverter}"
LongitudeMemberPath="Points[0][0].X"
LatitudeMemberPath="Points[0][0].Y">
</ig:GeographicSymbolSeries>
</ig:XamGeographicMap.Series>
</ig:XamGeographicMap>
In Visual Basic:
' create and set data binding to the GeographicSymbolSeries
Dim geoSeries = New GeographicSymbolSeries()
geoSeries.ItemsSource = shapefileConverter
geoSeries.LongitudeMemberPath = "Points[0][0].X"
geoSeries.LatitudeMemberPath = "Points[0][0].Y"
' add the GeographicSymbolSeries to the the XamGeographicMap
Me.GeoMap.Series.Add(geoSeries)
In C#:
// create and set data binding to the GeographicSymbolSeries
var geoSeries = new GeographicSymbolSeries();
geoSeries.ItemsSource = shapefileConverter;
geoSeries.LongitudeMemberPath = "Points[0][0].X";
geoSeries.LatitudeMemberPath = "Points[0][0].Y";
// add the GeographicSymbolSeries to the the XamGeographicMap
this.GeoMap.Series.Add(geoSeries);
The following topics provide additional information related to this topic.