Version

Displaying Geographic Imagery from ArcGIS Online Servers

Purpose

This topic provides information on how to display geographic imagery from ArcGIS Online servers in the background content of the XamGeographicMap™ 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 XamGeographicMap control to an application page.

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

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

Displaying Geographic Imagery from ArcGIS Online Servers

Overview

ArcGIS Online is an Esri product that allows you to create and share maps either publicly or privately. You can also access other maps created by Esri and other ArcGIS users.

You can see a list of some available public maps at the following location, Esri Maps and Data Group .

The XamGeographicMap control displays geographic imagery from ArcGIS Online in the map background content using the ArcGISOnlineMapImagery class.

Public maps can be displayed by setting the MapServerUri property of the ArcGISOnlineMapImagery class to the map’s specified URI.

Private maps involve more configuration than simply setting the MapServerUri. You must use an access token either provided by the owner of the map or generated via a Username, and Password combination also provided by the owner.

Preview

The following screenshot is a preview of the XamGeographicMap control with geographic imagery tile from map content on an ArcGIS Online server.

GeographicMap Displaying Geographic Imagery from ArcGISOnline Servers 1 1.png

Public Maps

Overview

The map owner can allow a map to be publicly accessible and provide the URI for that map.

In order to use geographic imagery from ArcGIS public maps, you must first obtain the map’s public URI. You must then set this map URI to the ArcGISOnlineMapImagery object’s MapServerUri property.

Example

The following screenshot illustrates the rendering of the XamGeographicMap control with the BackgroundContent property set to the ArcGISOnlineMapImagery.

The MapServerUri property of the ArcGISOnlineMapImagery object is set to following value:

GeographicMap Displaying Geographic Imagery from ArcGISOnline Servers 1 1.png

In XAML:

<ig:XamGeographicMap x:Name="GeoMap"
                     Background="Transparent"
                     PlotAreaBackground="Transparent">
    <ig:XamGeographicMap.BackgroundContent>
       <ig:ArcGISOnlineMapImagery
           MapServerUri="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
    </ig:XamGeographicMap.BackgroundContent>
</ig:XamGeographicMap>

In C#:

var publicMap = new ArcGISOnlineMapImagery();
publicMap.MapServerUri ="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer";
this.GeoMap.BackgroundContent = publicMap;

In Visual Basic:

Dim publicMap As var = New ArcGISOnlineMapImagery
publicMap.MapServerUri ="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
Me.GeoMap.BackgroundContent = publicMap

Private Maps

Overview

The map owner can set their map to be private, controlling access to specific users. This map can then be accessed, either with an access token provided by the owner of the map or one generated from a Username and Password combination.

Credentials

The following table summarizes the credential properties of the ArcGISOnlineMapImagery object used for accessing the private map content on ArcGIS Online servers.

Property Name Property Type Descriptions

String

This property, required to generate a token, specifies the user name.

String

This property, required to generate a token, specifies the password.

String

This property specifies the pre-generated token (either previously generated by the username/password combination or provided by the owner of the private map).

String

This optional property specifies the Referer contained in the WebRequest. In the case of WPF a default value is set.

Example

The following code example demonstrates how to set the ArcGISOnlineMapImagery object’s properties required for a private map.

Note
Note

You must replace strings set to the UserName, Password, MapServerUri and ReferURI properties to your own credentials and map information.

In XAML:

<ig:ArcGISOnlineMapImagery
   TokenGenerationEndPoint="https://www.arcgis.com/sharing/"
   IsMapPublic="False"
   UserName="USERNAME"
   Password="PASSWORD"
   DefaultTokenTimeout="65"
   MapServerUri="MAP_SERVER_URI"
   RefererUri="REFERER_URI" >
</ig:ArcGISOnlineMapImagery>

In C#:

var privMap = new ArcGISOnlineMapImagery();
privMap.TokenGenerationEndPoint = "https://www.arcgis.com/sharing/";
privMap.IsMapPublic = false;
privMap.UserName = "USERNAME";
privMap.Password = "PASSWORD";
privMap.DefaultTokenTimeout = 65;
privMap.MapServerUri = "MAP_SERVER_URI";
privMap.RefererURI = "REFERER_URI";

In Visual Basic:

Dim privMap As var = New ArcGISOnlineMapImagery
privMap.TokenGenerationEndPoint = "https://www.arcgis.com/sharing/"
privMap.IsMapPublic = false
privMap.UserName = "USERNAME"
privMap.Password = "PASSWORD"
privMap.DefaultTokenTimeout = 65
privMap.MapServerUri = "MAP_SERVER_URI"
privMap.ReferURI = "REFERER_URI"

Related Content

The following topics provide additional information related to this topic.

Topic Purpose

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

This topic provides information about layout of map elements in the XamGeographicMap control.

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