Version

Binding Geographic Data Models

Purpose

This topic provides information on how to bind the UltraGeographicMap™ control to models that contain geographic data.

Required background

The following table lists the topics required as a prerequisite to understanding this topic.

Topic Purpose

This topic provides information on how to add the UltraGeographicMap control to an application page.

This topic provides information about layout of map elements in the UltraGeographicMap control.

This topic provides information about supported types of geographic series in the UltraGeographicMap control.

In this topic

This topic contains the following sections

Binding Geographic Data Models

Introduction

The UltraGeographicMap control is designed to display geo-spatial data from shape files and/or geographic locations from data models on geographic imagery maps. The DataSource 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 :

Geographic Series Data Mapping Properties Description

Specify the names of data columns of DataSource items that contain geographic longitude and latitude coordinates of symbols. These properties must be mapped to data columns of numeric type such as double, integer, or float, etc.

Specifies the name of data column of DataSource items that contains the geographic points of shapes. This property must be mapped to a data column of IEnumerable<Infragistics.Win.DataVisualization.Point> or IEnumerable<IEnumerable<Infragistics.Win.DataVisualization.Point>>

Specifies the name of data column of DataSource items that contains the geographic coordinates of lines. This property must be mapped to a data column of IEnumerable<Infragistics.Win.DataVisualization.Point> or IEnumerable<IEnumerable<Infragistics.Win.DataVisualization.Point>>

Preview

The following is a preview of the UltraGeographicMap control with GeographicSymbolSeries bound to a data model that contains locations of some cities of the world.

GeographicMap Binding Geographic Data Models 1.png

Example

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 IEnumerable<Infragistics.Win.DataVisualization.Point> .

In Visual Basic:

Dim series = New GeographicSymbolSeries()
series.LongitudeMemberPath="X"
series.LatitudeMemberPath="Y"

Dim geoLocations = New List<Infragistics.Win.DataVisualization.Point>()

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.DataSource = geoLocations
Me.GeoMap.Series.Add(series)

In C#:

var series = new GeographicSymbolSeries();
series.LongitudeMemberPath="X";
series.LatitudeMemberPath="Y";
var geoLocations = new List<Infragistics.Win.DataVisualization.Point>();
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.DataSource = geoLocations;
this.GeoMap.Series.Add(series);

Related Content

The following topics provide additional information related to this topic.

Topic Purpose

This topic provides information on how to add the UltraGeographicMap control to an application page.

This topic provides information about layout of map elements in the UltraGeographicMap control.

This topic provides information about supported types of geographic series in the UltraGeographicMap control.

This topic provides resources with information about maps, shape files, and geo-spatial related material. Use these resources to learn about and obtain geo-spatial shape files as well as tools for their editing.

This topic provides information on how to bind shape files with geo-spatial data to the UltraGeographicMap control.