Version

Displaying Geographic Imagery from Azure Maps

Purpose

This topic provides information on displaying geographic imagery from Azure Maps in the background content of the UltraGeographicMap™ control.

Required background

The following table lists the topics required as a prerequisite to understanding this topic.

Topic Purpose

This topic provides information on how to add the UltraGeographicMap control to an application page.

This topic provides information about the layout of the visual elements in the control

This topic provides an overview of rendering geographic imagery in the background content of the UltraGeographicMap control.

In this topic

This topic contains the following sections:

Geographic Imagery from Azure Maps

Overview

Azure Maps is Microsoft’s® licensed geographic imagery mapping service. This geographic imagery service is accessible directly on the Azure Maps web site. The UltraGeographicMap control displays geographic imagery from Azure Maps in the map’s background content using the AzureMapsImagery class. However, by default the UltraGeographicMap control displays geographic imagery from the Open Street Maps in the map background content requiring you to configure the control to display Azure Maps’ geographic imagery. Prior to using Azure Maps’ geographic imagery, you must register and obtain a Azure Map API key from www.Azuremapsportal.com. You must use the Azure Maps’ API key to set the AzureMapsImagery object’s ApiKey property.

Previews

The following images are previews of the UltraGeographicMap control in supported map styles of geographic imagery from the Azure Maps service.

GeographicMap Displaying Geographic Imagery from Azure Maps 1.png

Azure Map imagery with Satellite style

GeographicMap Displaying Geographic Imagery from Azure Maps 2.png

Azure Map imagery with Road style

GeographicMap Displaying Geographic Imagery from Azure Maps 3.png

Azure Map imagery with HybridRoad style

Requirements

In order to use geographic imagery from Azure Maps, you must first register and obtain a Map API key from the www.Azuremapsportal.com website. You must set this Azure API key as the AzureMapsImagery object’s ApiKey property.

TLS1.2 or TLS1.3 is required in order for the map to render properly. If you are using .NET 4.7 and later, you can ignore this step. For more details please visit https://learn.microsoft.com/en-us/azure/azure-maps/azure-maps-authentication

A full list of frameworks support for TLS is listed here: TLS support in .NET Framework

Example 1. TLS 1.2

ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;

This is explicitly required when using eg. .NET 4.0 that doesnt' provide this out of the box. Make sure to add the line above in your eg. form’s constructor prior to adding the map.

Property settings

The following table summarizes important members of the AzureMapsImagery class.

Property Name Property Type Description

String

Represents the property for setting an API key required for the Azure Maps imagery service.

You must obtain this key from the http://www.Azuremapsportal.com website.

String

Represents a property for setting the culture name for the tile source.

Represents the property for setting the Azure Maps imagery tiles map style. This property can be set to the following AzureMapsImageryStyle enumeration values, such as:

  • Road - Specifies the map style with a terra overlay with roads and labels.

  • LabelsRoad - Specifies the map with roads and labels overlay only.

  • Imagery - Specifies the map style with no roads or labels providing a satellite perspective.

  • DarkGrey - Specifies the map in black and white with road and labels overlays.

Example

The screenshot following this table illustrates how to display geographic imagery from Azure Maps in the background content of the UltraGeographicMap control. This is accomplished by configuring the UltraGeographicMap control as follows:

Property * Value*

BackgroundContent

AzureMapsImagery

Road

Azure Map API key

GeographicMap Displaying Geographic Imagery from Azure Maps 2.png

Following is the code used in implementing this example:

Note
Note

You must replace those strings set to the ApiKey property with your own Azure Map API key.

In Visual Basic:

Dim igMap As UltraGeographicMap
Dim AzureMaps as AzureMapsImagery
AzureMaps.ImageryStyle = AzureMapsImageryStyle.Road
AzureMaps.ApiKey = "API_KEY"
igMap.SetImagery(AzureMaps)

In C#:

var igMap = new UltraGeographicMap
var AzureMaps = new AzureMapsImagery();
AzureMaps.ImageryStyle = AzureMapsImageryStyle.Road;
AzureMaps.ApiKey = "API_KEY";
igMap.SetImagery(AzureMaps);

Related Content

The following topics provide additional information related to this topic.

Topic Purpose

This topic provides information on how to bind geographic imagery in the UltraGeographicMap control.

This topic provides information on how to display geographic imagery from Open Street Maps service in the UltraGeographicMap control.