BingRestMapProvider
Provides comprehensive map services using Bing Maps REST APIs including tiles, routing, search, elevation, and truck routing capabilities.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.RadMap.dll
Syntax:
public class BingRestMapProvider : IMapProvider, ICloneable, IMapTileProvider, IMapRouteProvider, IMapTruckRouteProvider, IMapSearchProvider, IMapBaseSearchProvider, IMapElevationProvider
Inheritance: objectBingRestMapProvider
Implements:
Constructors
Initializes a new instance of the BingRestMapProvider class with default settings and configures tile downloading and caching.
public BingRestMapProvider()
Fields
protected Dictionary<string, List<TileInfo>> cacheLoadReference
protected Dictionary<string, TileInfo> tileMatrix
Properties
Gets or sets the Bing Maps API key used for authenticating requests to Bing Maps services and enabling premium features.
public string BingKey { get; set; }
The bing key.
Gets or sets the cache provider instance used for storing and retrieving map tiles from local storage.
public IMapCacheProvider CacheProvider { get; set; }
Implements:
Gets or sets the culture information used for localizing map content, search results, and routing instructions.
public CultureInfo Culture { get; set; }
The culture.
Gets or sets a value indicating whether tile caching is enabled for storing downloaded tiles locally to improve performance.
public bool EnableCaching { get; set; }
Implements:
Gets the unique identifier for this Bing Maps provider instance.
public string Id { get; }
Implements:
ImagerySet
ImagerySet
Gets or sets the Bing Maps imagery set that determines the visual style and content type of map tiles displayed.
public ImagerySet ImagerySet { get; set; }
The imagery set.
Gets or sets a value indicating whether this BingRestMapProvider has completed initialization and is ready for service calls.
public bool Initialized { get; protected set; }
true if initialized; otherwise, false.
Gets or sets a value indicating whether this BingRestMapProvider is currently performing initialization operations.
public bool Initializing { get; protected set; }
true if initializing; otherwise, false.
Gets or sets the maximum zoom level supported by this Bing Maps provider for tile requests and map display.
public int MaxZoomLevel { get; set; }
Implements:
Gets or sets the minimum zoom level supported by this Bing Maps provider for tile requests and map display.
public int MinZoomLevel { get; set; }
Implements:
Gets the unique session identifier obtained from Bing Maps logging service for optimized API usage and cost reduction.
public string SessionId { get; }
The session identifier.
Gets the settings that control tile rendering behavior.
public MapTileProviderSettings Settings { get; }
Implements:
Gets or sets the tile downloader instance responsible for asynchronously downloading map tiles from Bing Maps service.
public IMapTileDownloader TileDownloader { get; set; }
Implements:
Gets the standard tile size in pixels used by this Bing Maps provider for all tile requests and rendering operations.
public Size TileSize { get; }
Implements:
Gets or sets a value indicating whether to use session-based authentication for improved performance and reduced transaction costs.
public bool UseSession { get; set; }
true if session should be used; otherwise, false.
Methods
Constructs the Bing Maps elevation request URI based on the elevation request parameters and elevation type settings.
protected virtual Uri BuildElevationRequestUri(ElevationRequest request)
The elevation request containing parameters for URI construction.
Returns:The complete URI for the Bing Maps elevation API request.
Constructs the Bing Maps routing request URI based on the route request parameters and travel mode settings.
protected virtual Uri BuildRoutingRequestUri(RouteRequest request)
The route request containing parameters for URI construction.
Returns:The complete URI for the Bing Maps routing API request.
Constructs the Bing Maps search request URI based on the search request parameters and localization settings.
protected virtual Uri BuildSearchRequestUri(SearchRequest request)
The search request containing query parameters and search options.
Returns:The complete URI for the Bing Maps search API request.
Constructs the JSON request body for truck routing containing waypoints, vehicle specifications, and routing options.
protected virtual string BuildTruckRouteRequestBody(TruckRouteRequest request)
The truck route request containing parameters for JSON body construction.
Returns:The JSON request body string for the truck routing API call.
Constructs the Bing Maps truck routing request URI with authentication parameters for the truck routing service.
protected virtual Uri BuildTruckRouteRequestUri(TruckRouteRequest request)
The truck route request containing routing parameters.
Returns:The complete URI for the Bing Maps truck routing API request.
Performs an asynchronous elevation calculation using Bing Maps elevation services with the specified elevation request parameters.
public void CalculateElevationAsync(ElevationRequest request)
The elevation request containing points, bounds, and elevation calculation options.
Implements:
Performs an asynchronous route calculation using Bing Maps routing services with the specified route request parameters.
public void CalculateRouteAsync(RouteRequest request)
The route request containing waypoints, travel mode, and routing options.
Implements:
Performs an asynchronous truck route calculation using Bing Maps truck routing services with vehicle specifications and restrictions.
public void CalculateTruckRouteAsync(TruckRouteRequest request)
The truck route request containing waypoints, vehicle specifications, and routing constraints.
Implements:
Creates a deep copy of this BingRestMapProvider instance with all configuration settings and metadata information.
public object Clone()
A new BingRestMapProvider object that is a copy of this instance.
Implements:
Generates a unique cache key string for storing and retrieving tile images based on coordinates, zoom level, and imagery set.
Generates map visual elements for the specified viewport by converting cached tile images into renderable map tile elements.
public virtual IEnumerable<MapVisualElement> GetContent(IMapViewport viewport)
The map viewport defining the visible area and zoom level.
Returns:IEnumerable<MapVisualElement>
An enumerable collection of MapVisualElement objects representing map tiles.
Implements:
Converts a list of geographic points into a comma-separated string format for use in elevation API requests.
Retrieves a list of supported map views based on available Bing Maps imagery sets with localized names and selection state.
public virtual List<MapViewInfo> GetSupportedViews()
List<MapViewInfo>
A list of MapViewInfo objects representing available Bing Maps imagery sets.
Implements:
Constructs the URI for retrieving a specific map tile from Bing Maps service using tile matrix coordinates and zoom level.
Synchronously retrieves a tile image from Bing Maps service or cache using the specified tile matrix coordinates and zoom level.
Initializes this Bing Maps provider by establishing session authentication and retrieving imagery metadata for tile operations.
Handles the completion of imagery metadata initialization by processing service response and configuring tile size and zoom levels.
protected virtual void InitializeImageryMetadataCompleted(object sender, DownloadStringCompletedEventArgs e)
The sender.
eDownloadStringCompletedEventArgsThe DownloadStringCompletedEventArgs instance containing the event data.
Initializes the Bing Maps imagery service by retrieving metadata information for the current imagery set and configuring tile parameters.
Handles the completion of session initialization by extracting the session ID and proceeding to initialize imagery services.
protected virtual void InitializeSessionCompleted(object sender, DownloadStringCompletedEventArgs e)
The sender.
eDownloadStringCompletedEventArgsThe DownloadStringCompletedEventArgs instance containing the event data.
Raises the CalculateElevationCompleted event to notify subscribers that an elevation calculation has finished successfully.
protected virtual void OnCalculateElevationCompleted(ElevationCompletedEventArgs e)
The event arguments containing the calculated elevation data.
Handles the completion of elevation calculation by processing the JSON response and extracting elevation or sea level data.
protected virtual void OnCalculateElevationCompleted(object sender, DownloadStringCompletedEventArgs e)
The sender.
eDownloadStringCompletedEventArgsThe DownloadStringCompletedEventArgs instance containing the event data.
Raises the CalculateElevationError event to notify subscribers that an elevation calculation has encountered an error.
protected virtual void OnCalculateElevationError(CalculateElevationErrorEventArgs e)
The event arguments containing the elevation calculation error details.
Handles the completion of route calculation by processing the JSON response and extracting route information.
protected virtual void OnCalculateRouteCompleted(object sender, DownloadStringCompletedEventArgs e)
The sender.
eDownloadStringCompletedEventArgsThe DownloadStringCompletedEventArgs instance containing the event data.
Raises the CalculateRouteCompleted event to notify subscribers that a route calculation has finished successfully.
protected virtual void OnCalculateRouteCompleted(RoutingCompletedEventArgs e)
The event arguments containing the calculated routes.
Raises the CalculateRouteError event to notify subscribers that a route calculation has encountered an error.
protected virtual void OnCalculateRouteError(CalculateRouteErrorEventArgs e)
The event arguments containing the route calculation error details.
Handles the completion of truck route calculation by processing the JSON response and extracting truck route information.
protected virtual void OnCalculateTruckRouteCompleted(object sender, UploadStringCompletedEventArgs e)
The sender.
eUploadStringCompletedEventArgsThe UploadStringCompletedEventArgs instance containing the event data.
Raises the CalculateTruckRouteCompleted event to notify subscribers that a truck route calculation has finished successfully.
protected virtual void OnCalculateTruckRouteCompleted(RoutingCompletedEventArgs e)
The event arguments containing the calculated truck routes.
Raises the CalculateTruckRouteError event to notify subscribers that a truck route calculation has encountered an error.
protected virtual void OnCalculateTruckRouteError(CalculateRouteErrorEventArgs e)
The event arguments containing the truck route calculation error details.
Raises the InitializationComplete event to notify subscribers that provider initialization has finished.
protected virtual void OnInitializationComplete(EventArgs e)
The event arguments.
Raises the InitializationError event to notify subscribers that provider initialization has failed.
protected virtual void OnInitializationError(InitializationErrorEventArgs e)
The event arguments containing the initialization error details.
Raises the ProviderUpdated event to notify subscribers that provider content has changed.
Raises the SearchCompleted event to notify subscribers that a search operation has finished successfully.
protected virtual void OnSearchCompleted(SearchCompletedEventArgs e)
The event arguments containing the search results.
Raises the SearchError event to notify subscribers that a search operation has encountered an error.
protected virtual void OnSearchError(SearchErrorEventArgs e)
The event arguments containing the search error details.
Handles the completion of search requests by processing the JSON response and extracting location information using multiple encoding strategies.
protected virtual void OnSearchRequestCompleted(object sender, DownloadStringCompletedEventArgs e)
The sender.
eDownloadStringCompletedEventArgsThe DownloadStringCompletedEventArgs instance containing the event data.
Handles tile download completion events, manages cache storage, and updates wraparound tiles with downloaded content.
protected virtual void OnTileDownloadComplete(object sender, TileInfoEventArgs e)
The sender.
eTileInfoEventArgsThe TileInfoEventArgs instance containing the event data.
Performs an asynchronous search operation using Bing Maps search services with the specified search request parameters.
public void SearchAsync(SearchRequest request)
The search request containing query text and search options.
Implements:
Sets the active map view by configuring the imagery set based on the specified view information and label settings.
public virtual void SetView(MapViewInfo view)
The map view information containing the desired imagery set name and label preferences.
Implements:
Responds to viewport changes by calculating visible tiles, managing tile downloads, and updating the tile matrix for rendering.
public void ViewportChanged(IMapViewport viewport, ViewportChangeAction action)
The current map viewport containing zoom level and visible area information.
actionViewportChangeActionThe type of viewport change that occurred.
Implements:
Events
Occurs when an elevation calculation operation has completed successfully with elevation results.
public event EventHandler<ElevationCompletedEventArgs> CalculateElevationCompleted
Implements:
Occurs when an elevation calculation operation encounters an error during execution.
public event EventHandler<CalculateElevationErrorEventArgs> CalculateElevationError
Implements:
Occurs when a route calculation operation has completed successfully with routing results.
public event EventHandler<RoutingCompletedEventArgs> CalculateRouteCompleted
Implements:
Occurs when a route calculation operation encounters an error during execution.
public event EventHandler<CalculateRouteErrorEventArgs> CalculateRouteError
Implements:
Occurs when a truck route calculation operation has completed successfully with truck routing results.
public event EventHandler<RoutingCompletedEventArgs> CalculateTruckRouteCompleted
Implements:
Occurs when a truck route calculation operation encounters an error during execution.
public event EventHandler<CalculateRouteErrorEventArgs> CalculateTruckRouteError
Implements:
Occurs when the Bing Maps provider has completed its initialization process and is ready for use.
public event EventHandler InitializationComplete
Implements:
Occurs when provider initialization encounters an error during setup.
public event InitializationErrorEventHandler InitializationError
Implements:
Occurs when the provider content has been updated with new tile data or configuration changes.
public event EventHandler ProviderUpdated
Implements:
Occurs when a search operation has completed successfully with search results.
public event EventHandler<SearchCompletedEventArgs> SearchCompleted
Implements:
Occurs when a search operation encounters an error during execution.
public event EventHandler<SearchErrorEventArgs> SearchError
Implements: