# Getting Started with WinUI Map

The `RadMap` control allows you to display rich geographical information from various sources, 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:

## Assembly References

In order to use the RadMap control in your projects, you have to add references to the following assembly:

* `Telerik.WinUI.Controls.dll`
* `Telerik.Licensing.Runtime.dll`

## Defining a Map

After adding references to the aforementioned dll, you can declare a new RadMap as any normal WinUI control.

> You can access the RadMap controls through an alias pointing to the Telerik.UI.Xaml.Controls.DataVisualization namespace: xmlns:dataVisualization="using:Telerik.UI.Xaml.Controls.DataVisualization"

#### **Defining map in XAML**

```XAML
<Grid x:Name="LayoutRoot">
	<dataVisualization:RadMap x:Name="radMap" />
</Grid>
```

## Styling the Component

To display the RadMap control, you will need to apply its theme. To do so, merge the **Generic.xaml** `ResourceDictionary` in the **App.xaml** file.

#### **Styling the RadMap control**

```XAML
<Application.Resources> 
	<ResourceDictionary> 
		<ResourceDictionary.MergedDictionaries> 
			<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" /> 
			<ResourceDictionary Source="ms-appx:///Telerik.WinUI.Controls/Themes/Generic.xaml"/> 
			 
		</ResourceDictionary.MergedDictionaries> 
		 
	</ResourceDictionary> 
</Application.Resources> 
```

## Specifying a Provider

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:

* [OpenStreet Maps](https://www.telerik.com/winui/documentation/controls/radmap/features/providers/providers#openstreet-maps)

* [ArcGIS Online](https://www.telerik.com/winui/documentation/controls/radmap/features/providers/arcgis)

* [Empty Provider](https://www.telerik.com/winui/documentation/controls/radmap/features/providers/empty-provider)

* [URI Image provider](https://www.telerik.com/winui/documentation/controls/radmap/features/providers/uriimageprovider)

* [Azure Map Provider](https://www.telerik.com/winui/documentation/controls/radmap/features/providers/azuremapprovider)

* **WMS**

This example will use `OpenStreetMap` as its provider. In order to do that you have to set the `Provider` property of the RadMap to the built-in `OpenStreetMapProvider` class.

> You can access the RadMap providers through an alias pointing to the Telerik.UI.Xaml.Controls.DataVisualization.Map namespace:  xmlns:telerikMap="using:Telerik.UI.Xaml.Controls.DataVisualization.Map"

#### **Specifying provider to the RadMap control**

```XAML
<Grid x:Name="LayoutRoot">
	<dataVisualization:RadMap x:Name="map">
		<dataVisualization:RadMap.Provider>
			<telerikMap:OpenStreetMapProvider APIKey="Your API Key" StandardModeUserAgent="Your User Agent"/>
		</dataVisualization:RadMap.Provider>
	</dataVisualization:RadMap>
</Grid>
```

#### **Setting OpenStreetMapProvider**

```C#
this.radMap.Provider = new OpenStreetMapProvider() { APIKey="Your API Key", StandardModeUserAgent="Your User Agent" };
```

After specifying the provider, you should be able to see the respective map appear in the RadMap control.

![WinUI RadMap](https://www.telerik.com/winui/documentation/assets/825f775cc257679f801957e9e786d563/radmap_gettingstarted_01.png)

## Displaying Data

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 `VisualizationLayer`. To learn more about this layer and how to display the different types of elements in them, please read the [Visualization layer](https://www.telerik.com/winui/documentation/controls/radmap/features/visualization-layer/introduction) section.

## Telerik UI for WinUI Learning Resources

* [Telerik UI for WinUI Map Component](https://www.telerik.com/winui/map)
* [Getting Started with Telerik UI for WinUI Components](https://www.telerik.com/winui/documentation/getting-started/first-steps-nuget)
* [Telerik UI for WinUI Installation](https://www.telerik.com/winui/documentation/installation-and-deployment/installing-which-file-do-i-need)
* [Telerik UI for WinUI Examples](https://www.telerik.com/winui/documentation/examples/demos-app)
* [Telerik UI for WinUI Accessibility](https://www.telerik.com/winui/documentation/common/accessibility)
* [Telerik UI for WinUI License Agreement](https://www.telerik.com/purchase/license-agreement/winui)

## See Also

* [Overview](https://www.telerik.com/winui/documentation/controls/radmap/overview)
