ComponentOne Maps for UWP
C1Maps Main Concepts

Select one of the tabs below for more information on C1Maps' Main Concepts. The content includes:

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. The code below each source can be added to your project's code file to change the map source:

  • Virtual Earth Aerial Source

               

Visual Basic
Copy Code
map1.Source = new VirtualEarthAerialSource()

C#
Copy Code
map1.Source = new VirtualEarthAerialSource();

 

 

  • Virtual Earth Road Source

Visual Basic
Copy Code
map2.Source = new VirtualEarthRoadSource()

C#
Copy Code
map2.Source = new VirtualEarthRoadSource();

 

 

  • Virtual Earth Hybrid Source
Visual Basic
Copy Code
map3.Source = new VirtualEarthHybridSource()

C#
Copy Code
map3.Source = new VirtualEarthHybridSource();

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

  • Center

This 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. You can set this property either in XAML markup or in code:

XAML
Copy Code
<Maps:C1Maps Name="maps" Center="-58.40, -34.36"/>

 

C#
Copy Code
maps.Center = new Point(-58.40, -34.36);
  • Zoom

This 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. You can set this property either in XAML markup or in code:

XAML
Copy Code
<Maps:C1Maps Name="maps" MinZoomValue= "5" MaxZoomValue= "15"/>

 

C#
Copy Code
maps.MinZoomValue = 5;
maps.MaxZoomValue = 15;

 

C1Maps uses three coordinate systems:

  • Geographic coordinates mark points in the world using latitude and longitude. Longitude is the X value, and latitude is the Y value. The coordinates are not marked with N, S, E, or W to designate the hemisphere. 
    • Longitudinal values in the Eastern Hemisphere are positive numbers.
    • Longitudinal values in the Western Hemisphere are negative numbers.
    • Latitudinal values in the Northern Hemisphere are positive numbers.
    • Latitudinal values in the Southern Hemisphere are negative numbers.

This coordinate system is not Cartesian, which means the scale of the map may change as you pan.

A coordinate pair for a city in the Northern and Eastern hemispheres will resemble the following:

(131.9, 43.1333)

These are the coordinates for the Russian city Vladivostok. Both the longitude and latitude coordinates are positive numbers since Vladivostok's coordinates are in the East (longitude) and North (latitude).

If you were putting in coordinates for an area in South America (West - longitude) below the Equator (South - latitude), you will write the coordinates with negative numbers, like the coordinates for Buenos Aires, Brazil:

(-58.40, -34.36)

  • 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: ScreenToGeographicScreenToLogicGeographicToScreen, and LogicToScreen. The conversion between geographic and logic coordinates is done by the projection configured using the C1Maps.Projection property.

You can implement other GIS projections by inheriting from the IMapProjection interface, but the default is the Mercator projection used by LiveMaps and most other providers.

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.

You can see the three layers you'll use most in the following image:

  • 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.
  • 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.