Skip to main content
A newer version of this page is available. .

How to: Connect to Bing Maps Using a Smart Tag

This is a short introductory example, which describes how to connect a Map control using a smart tag.

To connect a Map control to Bing Maps, click the Map control’s smart tag to invoke its actions list. In the actions list, click the Connect to Bing Maps link.

how-to-use-smart-tag-01

After this, your XAML should look like the following.

<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:dxm="http://schemas.devexpress.com/winfx/2008/xaml/map" 
        x:Class="DXMapExample.MainWindow"
        Title="MainWindow" Height="389.5" Width="521" Loaded="Window_Loaded">

    <Grid>
        <dxm:MapControl>
            <dxm:ImageLayer>
                <dxm:ImageLayer.DataProvider>
                    <dxm:BingMapDataProvider Kind="Area" BingKey="INSERT_BING_MAPS_KEY"/>
                </dxm:ImageLayer.DataProvider>
            </dxm:ImageLayer>
        </dxm:MapControl>
    </Grid>
</Window>

If you run the application, and see a window with the following error message: ”The specified Bing Maps key is invalid. To create a developer account, refer to https://www.microsoft.com/en-us/maps/create-a-bing-maps-key”, refer to the following tutorial: How to: Get a Bing Maps Key.

The following image shows the launched application.

lesson1-result

See Also