New to Telerik UI for WPFStart a free 30-day trial

Represents the Bing REST Map Provider class.

Definition

Namespace:Telerik.Windows.Controls.Map

Assembly:Telerik.Windows.Controls.DataVisualization.dll

Syntax:

C#
[Obsolete("This class is obsolete and will be deleted in Q2 2026.")]
public class BingRestMapProvider : TiledProvider, IDisposable, IBingRestSearchLocationProvider, IBingRestRouteProvider, IBingRestTruckRouteProvider, IBingRestElevationProvider, ICloneable

Inheritance: objectMapProviderBaseTiledProviderBingRestMapProvider

Implements: IBingRestElevationProviderIBingRestRouteProviderIBingRestSearchLocationProviderIBingRestTruckRouteProviderICloneableIDisposable...

Inherited Members TiledProvider.IsTileCachingEnabledPropertyTiledProvider.CacheStoragePropertyTiledProvider.RequestCacheLevelPropertyTiledProvider.RequestCredentialsPropertyTiledProvider.IsTileCachingEnabledChanged(bool, bool)TiledProvider.CacheStorageChanged()TiledProvider.RequestCacheLevelChanged()TiledProvider.RequestCredentialsChanged()TiledProvider.InheritParameters(MapProviderBase)TiledProvider.InheritCacheStorage(TiledMapSource)TiledProvider.OnIsTileCachingEnabledChanged(bool, bool)TiledProvider.InheritRequestCacheLevel(TiledMapSource)TiledProvider.InheritRequestCredentials(TiledMapSource)TiledProvider.IsTileCachingEnabledTiledProvider.CacheStorageTiledProvider.RequestCacheLevelTiledProvider.RequestCredentialsMapProviderBase.GeoBoundsPropertyMapProviderBase.GeoBoundsNWPropertyMapProviderBase.GeoBoundsSEPropertyMapProviderBase.OpacityPropertyMapProviderBase.Dispose()MapProviderBase.GetValidatedGeoPoint(Location)MapProviderBase.SetMapSource(string)MapProviderBase.TryGetMapSource(string, out IMapSource)MapProviderBase.CreateInstanceCore()MapProviderBase.InheritCurrentSource(MapProviderBase)MapProviderBase.RegisterSetSourceCommand(Type, string, DataTemplate, Uri, CanExecuteRoutedEventHandler, ExecutedRoutedEventHandler)MapProviderBase.SourceInitializationFaulted(object, InitializationFaultEventArgs)MapProviderBase.CommandBindingCollectionMapProviderBase.CommandsMapProviderBase.GeoBoundsMapProviderBase.GeoBoundsNWMapProviderBase.GeoBoundsSEMapProviderBase.OpacityMapProviderBase.SupportedSourcesMapProviderBase.MapSourcesMapProviderBase.InitializationFaultedMapProviderBase.MapSourceChangedMapProviderBase.SpatialReferenceChanged...

Constructors

Initializes a new instance of the BingRestMapProvider class.

C#
public BingRestMapProvider()

Initializes a new instance of the BingRestMapProvider class.

C#
public BingRestMapProvider(MapMode mode, BingTopLayer topLayer, string applicationId, bool useSession)
Parameters:modeMapMode

Map mode.

topLayerBingTopLayer

Bing top layer option.

applicationIdstring

Bing Maps Key.

useSessionbool

Value which indicates whether Bing session should be used.

Initializes a new instance of the BingRestMapProvider class.

C#
public BingRestMapProvider(MapMode mode, bool labelVisible, string applicationId, bool useSession)
Parameters:modeMapMode

Map mode.

labelVisiblebool

Is labels visible.

applicationIdstring

Bing Maps Key.

useSessionbool

Value which indicates whether Bing session should be used.

Initializes a new instance of the BingRestMapProvider class.

C#
public BingRestMapProvider(MapMode mode, bool labelVisible, string applicationId)
Parameters:modeMapMode

Map mode.

labelVisiblebool

Is labels visible.

applicationIdstring

Bing Maps Key.

Initializes a new instance of the BingRestMapProvider class.

C#
public BingRestMapProvider(string applicationId)
Parameters:applicationIdstring

Bing Maps Key.

Fields

IsLabelVisibleProperty

DependencyProperty

Identifies the IsLabelVisible dependency property.

C#
public static readonly DependencyProperty IsLabelVisibleProperty

ModeProperty

DependencyProperty

Identifies the Mode dependency property.

C#
public static readonly DependencyProperty ModeProperty

TopLayerProperty

DependencyProperty

Identifies the TopLayer dependency property.

C#
public static readonly DependencyProperty TopLayerProperty

UseSessionProperty

DependencyProperty

Identifies the UseSession dependency property.

C#
public static readonly DependencyProperty UseSessionProperty

Properties

Gets or sets Bing application ID.

C#
public string ApplicationId { get; set; }

Gets or sets value which indicates whether labels should be visible on the map.

C#
public bool IsLabelVisible { get; set; }

Gets or sets map mode.

C#
public MapMode Mode { get; set; }

Returns the SpatialReference for the map provider.

C#
public override ISpatialReference SpatialReference { get; }

Overrides: MapProviderBase.SpatialReference

Gets or sets the top layer option of the Bing rest imagery service. Runtime change is not supported.

C#
public BingTopLayer TopLayer { get; set; }

Gets or sets value which indicates whether Bing session should be used. Make sense during provider initialization only.

C#
public bool UseSession { get; set; }

Methods

Apply map source modes.

C#
protected override string ApplySourceModes(string uniqueId)
Parameters:uniqueIdstring

Base source unique ID.

Returns:

string

Unique ID of the map source with applied modes.

Overrides: MapProviderBase.ApplySourceModes(string)

Remarks:

Some providers (Bing, for example) can have different modes for the same base source (arial with/without labels in Bing, for example). This method allows apply this kind of modes to the base source.

Builds a string URI based on the BingRestElevationRequest.

C#
protected virtual Uri BuildElevationRequestUri(BingRestElevationRequest request)
Parameters:requestBingRestElevationRequestReturns:

Uri

Builds a string URI based on the BingRestRouteRequest.

C#
protected virtual Uri BuildRoutingRequestUri(BingRestRouteRequest request)
Parameters:requestBingRestRouteRequestReturns:

Uri

Creates a string URI based on the BingRestSearchLocationRequest.

C#
protected virtual Uri BuildSearchLocationRequestUri(BingRestSearchLocationRequest request)
Parameters:requestBingRestSearchLocationRequestReturns:

Uri

Builds a JSON body based on the BingRestTruckRouteRequest

C#
protected virtual string BuildTruckRouteRequestBody(BingRestTruckRouteRequest request)
Parameters:requestBingRestTruckRouteRequest

The request to build the JSON for.

Returns:

string

Builds a JSON body based on the BingRestVehicleSpec

C#
protected virtual string BuildTruckRouteVehicleSpecsBody(BingRestVehicleSpec spec)
Parameters:specBingRestVehicleSpec

The vehicle spec.

Returns:

string

Builds a string URI based on the BingRestTruckRouteRequest.

C#
protected virtual Uri BuildTruckRoutingRequestUri(BingRestTruckRouteRequest request)
Parameters:requestBingRestTruckRouteRequestReturns:

Uri

Performs async elevation request. Calculates elevation for given list of latitude and longitude pairs. Alternatively can calculate the elevation of equally spaced points along a polyline.

C#
public void CalculateElevationAsync(BingRestElevationRequest request)
Parameters:requestBingRestElevationRequest

Elevation request.

Implements: IBingRestElevationProvider.CalculateElevationAsync(BingRestElevationRequest)

Calculates the route specified by the BingRestRouteRequest.

C#
public void CalculateRouteAsync(BingRestRouteRequest request)
Parameters:requestBingRestRouteRequest

Implements: IBingRestRouteProvider.CalculateRouteAsync(BingRestRouteRequest)

Calculates the truck route specified by the BingRestRouteRequest.

C#
public void CalculateTruckRouteAsync(BingRestTruckRouteRequest request)
Parameters:requestBingRestTruckRouteRequest

Implements: IBingRestTruckRouteProvider.CalculateTruckRouteAsync(BingRestTruckRouteRequest)

Implements the ICloneable interface.

C#
public object Clone()
Returns:

object

Cloned object.

Implements: ICloneable.Clone()

Called by the Dispose() and Finalize() methods to release the unmanaged resources used by the current instance of the BingRestMapProvider class.

C#
protected override void Dispose(bool disposing)
Parameters:disposingbool

True to release unmanaged and managed resources; false to release only unmanaged resources.

Overrides: MapProviderBase.Dispose(bool)

Builds locations string used in the service request.

C#
protected virtual string GetPointsString(List<Location> points)
Parameters:pointsList<Location>Returns:

string

Called when calculation of elevation is completed.

C#
protected virtual void OnCalculateElevationCompleted(BingRestElevationCompletedEventArgs e)
Parameters:eBingRestElevationCompletedEventArgs

Called when calculation of elevation is completed.

C#
protected virtual void OnCalculateElevationCompleted(object sender, DownloadStringCompletedEventArgs e)
Parameters:senderobjecteDownloadStringCompletedEventArgs

Called when calculation of elevation returns error.

C#
protected virtual void OnCalculateElevationError(BingRestCalculateElevationErrorEventArgs e)
Parameters:eBingRestCalculateElevationErrorEventArgs

Called when the calculation of route is completed.

C#
protected virtual void OnCalculateRouteCompleted(BingRestRoutingCompletedEventArgs e)
Parameters:eBingRestRoutingCompletedEventArgs

Called when calculation of route is completed.

C#
protected virtual void OnCalculateRouteCompleted(object sender, DownloadStringCompletedEventArgs e)
Parameters:senderobjecteDownloadStringCompletedEventArgs

Called when the calculation of route produces an error.

C#
protected virtual void OnCalculateRouteError(BingRestCalculateRouteErrorEventArgs e)
Parameters:eBingRestCalculateRouteErrorEventArgs

Called when the calculation of a truck route is completed.

C#
protected virtual void OnCalculateTruckRouteCompleted(BingRestRoutingCompletedEventArgs e)
Parameters:eBingRestRoutingCompletedEventArgs

Called when calculation of route is completed.

C#
protected virtual void OnCalculateTruckRouteCompleted(object sender, UploadStringCompletedEventArgs e)
Parameters:senderobjecteUploadStringCompletedEventArgs

Called when the calculation of a truck route results in an error.

C#
protected virtual void OnCalculateTruckRouteError(BingRestCalculateRouteErrorEventArgs e)
Parameters:eBingRestCalculateRouteErrorEventArgs

Called before map provider switch to another map source.

C#
protected override bool OnPreviewSourceChange(IMapSource source)
Parameters:sourceIMapSource

Map source which will be used.

Returns:

bool

Overrides: MapProviderBase.OnPreviewSourceChange(IMapSource)

Called after map provider switch to another map source.

C#
protected override void OnPreviewSourceChanged(IMapSource source)
Parameters:sourceIMapSource

Map source is used.

Overrides: MapProviderBase.OnPreviewSourceChanged(IMapSource)

Called when the search is completed.

C#
protected virtual void OnSearchLocationCompleted(BingRestSearchLocationCompletedEventArgs e)
Parameters:eBingRestSearchLocationCompletedEventArgs

Called when search error occurs.

C#
protected virtual void OnSearchLocationError(BingRestSearchLocationErrorEventArgs e)
Parameters:eBingRestSearchLocationErrorEventArgs

Called when the services returns response from the received BingSearchLocationRequest.

C#
protected virtual void OnSearchRequestCompleted(object sender, DownloadStringCompletedEventArgs e)
Parameters:senderobjecteDownloadStringCompletedEventArgs

Registers new set source command.

C#
public void RegisterSetSourceCommand(MapMode imagerySet, string text, DataTemplate dataTemplate = null, Uri imageUri = null)
Parameters:imagerySetMapMode

MapMode type.

textstring

Command text.

dataTemplateDataTemplate

Data template for command representation.

imageUriUri

URI of the image is used in the map source button data template.

Performs async search location request.

C#
public void SearchLocationAsync(BingRestSearchLocationRequest request)
Parameters:requestBingRestSearchLocationRequest

Search request.

Implements: IBingRestSearchLocationProvider.SearchLocationAsync(BingRestSearchLocationRequest)

Set state of the commands depends on the new map source.

C#
protected override void SetCommandState(string uniqueId)
Parameters:uniqueIdstring

Map source unique ID.

Overrides: MapProviderBase.SetCommandState(string)

Set specific map source to clone of map provider.

C#
public override void SetMapSourceToClone(MapProviderBase clone, string uniqueId)
Parameters:cloneMapProviderBase

Clone of map provider.

uniqueIdstring

Id of map source.

Overrides: MapProviderBase.SetMapSourceToClone(MapProviderBase, string)

Called when map source is changed for tile presenter and map source initialization completed.

C#
protected override void TilePresenterMapSourceChanged(object sender, SourceChangedEventArgs e)
Parameters:senderobject

Sender.

eSourceChangedEventArgs

Event parameters.

Overrides: MapProviderBase.TilePresenterMapSourceChanged(object, SourceChangedEventArgs)

Events

Occurs when an elevation calculation request is completed and the result is ready.

C#
public event EventHandler<BingRestElevationCompletedEventArgs> CalculateElevationCompleted

Implements: IBingRestElevationProvider.CalculateElevationCompleted

Occurs when the request results in an error.

C#
public event EventHandler<BingRestCalculateElevationErrorEventArgs> CalculateElevationError

Implements: IBingRestElevationProvider.CalculateElevationError

Occurs when a route calculation request is completed and the result is ready.

C#
public event EventHandler<BingRestRoutingCompletedEventArgs> CalculateRouteCompleted

Implements: IBingRestRouteProvider.CalculateRouteCompleted

Occurs when the request results in an error.

C#
public event EventHandler<BingRestCalculateRouteErrorEventArgs> CalculateRouteError

Implements: IBingRestRouteProvider.CalculateRouteError

Occurs when a truck route calculation request is completed and the result is ready.

C#
public event EventHandler<BingRestRoutingCompletedEventArgs> CalculateTruckRouteCompleted

Implements: IBingRestTruckRouteProvider.CalculateTruckRouteCompleted

Occurs when the request results in an error.

C#
public event EventHandler<BingRestCalculateRouteErrorEventArgs> CalculateTruckRouteError

Implements: IBingRestTruckRouteProvider.CalculateTruckRouteError

Event occurs when BingRestMapProvider completed search request.

C#
public event EventHandler<BingRestSearchLocationCompletedEventArgs> SearchLocationCompleted

Implements: IBingRestSearchLocationProvider.SearchLocationCompleted

Occurs when the request results in an error.

C#
public event EventHandler<BingRestSearchLocationErrorEventArgs> SearchLocationError

Implements: IBingRestSearchLocationProvider.SearchLocationError

In this article
DefinitionConstructorsBingRestMapProvider()BingRestMapProvider(MapMode, BingTopLayer, string, bool)BingRestMapProvider(MapMode, bool, string, bool)BingRestMapProvider(MapMode, bool, string)BingRestMapProvider(string)FieldsIsLabelVisiblePropertyModePropertyTopLayerPropertyUseSessionPropertyPropertiesApplicationIdIsLabelVisibleModeSpatialReferenceTopLayerUseSessionMethodsApplySourceModes(string)BuildElevationRequestUri(BingRestElevationRequest)BuildRoutingRequestUri(BingRestRouteRequest)BuildSearchLocationRequestUri(BingRestSearchLocationRequest)BuildTruckRouteRequestBody(BingRestTruckRouteRequest)BuildTruckRouteVehicleSpecsBody(BingRestVehicleSpec)BuildTruckRoutingRequestUri(BingRestTruckRouteRequest)CalculateElevationAsync(BingRestElevationRequest)CalculateRouteAsync(BingRestRouteRequest)CalculateTruckRouteAsync(BingRestTruckRouteRequest)Clone()Dispose(bool)GetPointsString(List<Location>)OnCalculateElevationCompleted(BingRestElevationCompletedEventArgs)OnCalculateElevationCompleted(object, DownloadStringCompletedEventArgs)OnCalculateElevationError(BingRestCalculateElevationErrorEventArgs)OnCalculateRouteCompleted(BingRestRoutingCompletedEventArgs)OnCalculateRouteCompleted(object, DownloadStringCompletedEventArgs)OnCalculateRouteError(BingRestCalculateRouteErrorEventArgs)OnCalculateTruckRouteCompleted(BingRestRoutingCompletedEventArgs)OnCalculateTruckRouteCompleted(object, UploadStringCompletedEventArgs)OnCalculateTruckRouteError(BingRestCalculateRouteErrorEventArgs)OnPreviewSourceChange(IMapSource)OnPreviewSourceChanged(IMapSource)OnSearchLocationCompleted(BingRestSearchLocationCompletedEventArgs)OnSearchLocationError(BingRestSearchLocationErrorEventArgs)OnSearchRequestCompleted(object, DownloadStringCompletedEventArgs)RegisterSetSourceCommand(MapMode, string, DataTemplate, Uri)SearchLocationAsync(BingRestSearchLocationRequest)SetCommandState(string)SetMapSourceToClone(MapProviderBase, string)TilePresenterMapSourceChanged(object, SourceChangedEventArgs)EventsCalculateElevationCompletedCalculateElevationErrorCalculateRouteCompletedCalculateRouteErrorCalculateTruckRouteCompletedCalculateTruckRouteErrorSearchLocationCompletedSearchLocationError
Not finding the help you need?
Contact Support