C1Maps Concepts and Main Properties

This section details basic C1Maps concepts and describes the main properties.

Map Source

C1Maps can display geographical information from several sources. By default, C1Maps uses Microsoft LiveMaps aerial photographs as the source, but you can change that using the Source property, which takes an object of type MultiScaleTileSource.

The following sources are included:

      Virtual Earth Aerial Source

Visual Basic

C#

      Virtual Earth Road Source

Visual Basic

C#

      Virtual Earth Hybrid Source

Visual Basic

C#

Visible Map

The portion of the map that is currently visible is determined by the Center and Zoom properties, and by the size of the control:

The Center property is of type Point but it actually represents a geographic coordinate in which the X property is longitude and the Y property is latitude. The user can change the value of the Center property by dragging the map with the mouse, or by using the navigator control shown on the left top corner.

The Zoom property indicates the current resolution of the map. A zoom value of 0 has the map totally zoomed out, and each increment of 1 doubles the map resolution. The user can change the value of the Zoom property using the mouse wheel or the zoom control on the left side of the control.

Coordinate Systems

C1Maps uses three coordinate systems:

      Geographic coordinates mark points in the world using latitude and longitude. This coordinate system is not Cartesian, which means the scale of the map may change as you pan.

      Logical coordinates go from 0 to 1 on each axis for the whole extent of the map, and they are easier to work with because they are Cartesian coordinates.

      Screen coordinates are the pixel coordinates of the Control relative to the top-left corner. These are useful for positioning items within the control and for handling mouse events.

C1Maps provides four methods for converting between these coordinate systems: ScreenToGeographic, ScreenToLogic, GeographicToScreen, and LogicToScreen. The conversion between geographic and logic coordinates is done by the projection configured using the C1Maps.Projection property. The projection can be changed to support a different map, the default is the Mercator projection used by LiveMaps and most other providers.

Information Layers

In addition to the geographical information provided by the source, you can add layers of information to the map. C1Maps includes five layers by default:

      C1MapItemsLayer is the layer used to display arbitrary items positioned geographically on the map. This layer is an ItemsControl, so it supports directly adding UIElement objects or generic data objects with a DataTemplate that can convert them into visual items.

      C1MapVirtualLayer displays items that are virtualized; this means they are only loaded when the region of the map they belong to is visible. It also supports asynchronous requests, so that new items can be downloaded from the server only when they come into view.

      C1VectorLayer displays vector data, like lines and polygons, whose vertices are geographically positioned. It can save and load data from KML files.

      C1MapToolsLayer is the next layer, used to display tools for panning and zooming, and a scale. This layer is built into C1Maps' template, so it's not necessary to add it manually.

      C1MapTilesLayer is the background layer where the map tiles are displayed. You normally don't have to use this layer because it is managed by C1Maps automatically.

Note: C1Maps only works in solutions that include a Web site or Web application project. If you use it in a standalone, single-project Silverlight solution, it will not display anything.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.