[]
This section details with basic C1Maps concepts and describes the main properties.
Map Source
C1Maps can display geographical information from several sources. By default, the Maps control uses Microsoft LiveMaps aerial photographs as the source, but you can change that using the Source property in C1Maps class, which takes an object of type MultiScaleTileSource.
The following sources are included:
Virtual Earth Aerial Source
Setting the Source property to an instance of VirtualEarthAerialSource class, lets the MultiScaleTileSource object type access Microsoft's Virtual Earth aerial tiles.
map1.Source = new VirtualEarthAerialSource();
Virtual Earth Road Source
Setting the Source property to an instance of VirtualEarthRoadSource class, lets the MultiScaleTileSource object type access Microsoft's Virtual Earth road tiles.
map2.Source = new VirtualEarthRoadSource();
Virtual Earth Hybrid Source
Setting the Source property to an instance of VirtualEarthHybridSource class, lets the MultiScaleTileSource object type access Microsoft's Virtual Earth hybrid tiles.
map3.Source = new VirtualEarthHybridSource();
Visibility
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:
MapItemsLayer 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.
MapVirtualLayer 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.
VectorLayer displays vector data, like lines and polygons, whose vertices are geographically positioned. It can save and load data from KML files.
MapToolsLayer 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.
MapTilesLayer 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.