The RadMap control allows you to display rich geographical information from various sources, including Microsoft Bing Maps, as well as to overlay the map with your own custom data. This topic will help you to quickly get started using the control. It will focus on the following:
In order to use RadMap in your projects you have to add references to the following assemblies:
You can find more info here.
After adding references to the aforementioned dlls, you can declare a new RadMap as any normal Silverlight/WPF control.
Example 1: Defining map in XAML
<UserControl xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"> <Grid x:Name="LayoutRoot"> <telerik:RadMap x:Name="radMap" /> </Grid> </UserControl>
The RadMap control doesn't display a map on itself, it needs a map provider from which to consume the required data. Currently the RadMap control supports a few providers out of the box:
This example will use Bing Maps as its provider. In order to do that you have to set the Provider property of the RadMap to the built-in BingMapProvider class.
Example 2: Specifying provider to the RadMap control
<UserControl xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"> <Grid x:Name="LayoutRoot"> <telerik:RadMap x:Name="radMap"> <telerik:RadMap.Provider> <telerik:BingRestMapProvider ApplicationId="Bing_Map_Key" Mode="Aerial" IsLabelVisible="True"/> </telerik:RadMap.Provider> </telerik:RadMap> </Grid> </UserControl>
Example 3: Setting BingRestMapProvider
this.radMap.Provider = new BingRestMapProvider( MapMode.Aerial, true, "key" );
Me.radMap.Provider = New BingRestMapProvider(MapMode.Aerial, True, "key")
Using the third overload of the BingRestMapProvider's constructor, allows you to pass some starting parameters:
The starting view mode of the map: Aerial.
The visibility of the map labels: Visible.
A Bing Maps specific key.
In order to use the Bing Maps with the RadMap control, you have to provide a valid Bing Maps Key. To learn how to obtain such a key, read this topic. Note that the Bing Map won't appear in your RadMap control, without supplying the key.
After specifying the provider, you should be able to see the respective map appear in the RadMap control.
You are able to display data on the top of the visualized map. The data may be represented by any framework element or map shape objects. This can be accomplished via the RadMap's layers.
There are two visualization engines in the RadMap package:
The old implementation of the map objects' (points and shapes) visualization consists of three layers: InformationLayer, DynamicLayer and VirtualizationLayer. This visualization engine, however, lacks certain features and has a few performance issues.
In the Q2 2013 release we introduced a new visualization engine in the RadMap. It has been designed from scratch to have better performance. The new visualization engine replaces all three layers with the new VisualizationLayer.
The major goals of the new engine are:
Improve the performance of the data visualization.
Allow reading map shapes from different sources (KML, ESRI, and SQL Geospatial) in the background thread.
Integrating clustering and items virtualization into the core. This simplifies the usage of both features.
Ability to attach/detach almost any input event available for the FrameworkElement to the map shape visualization.
Support of items selection in the engine core.
To learn more about the layers and how to display the different types of elements in them, please read the Visualization layer section.