Skip to content

Commit f66b86c

Browse files
authored
Merge pull request #279369 from stevemunk/migrate-get-static-map
Migrate from Bing Maps: Get Static Map API to Azure Maps Get Static Image
2 parents 69a709e + b2b8423 commit f66b86c

File tree

4 files changed

+138
-0
lines changed

4 files changed

+138
-0
lines changed
286 KB
Loading
-14.8 KB
Loading
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
---
2+
title: Migrate Bing Maps Get a Static Map API to Azure Maps Get Map Static Image API
3+
titleSuffix: Microsoft Azure Maps
4+
description: Learn how to Migrate the Bing Maps Get a Static Map API to the Azure Maps Get Map Static Image API.
5+
author: faterceros
6+
ms.author: aterceros
7+
ms.date: 06/26/2024
8+
ms.topic: how-to
9+
ms.service: azure-maps
10+
services: azure-maps
11+
---
12+
13+
# Migrate Bing Maps Get a Static Map API
14+
15+
This article explains how to migrate the Bing Maps [Get a Static Map] API to the Azure Maps [Get Map Static Image] API. Azure Maps Get Map Static Image API renders a user-defined, rectangular Road, Satellite/Aerial, or Traffic style map image.
16+
17+
## Prerequisites
18+
19+
- An [Azure Account]
20+
- An [Azure Maps account]
21+
- A [subscription key] or other form of [Authentication with Azure Maps]
22+
23+
## Notable differences
24+
25+
- Bing Maps Get a Static Map API offers Road, Satellite/Aerial, Traffic, Streetside, Birds Eye and Ordnance Survey maps styles. Azure Maps Get Map Static Image API offers the same styles except for Streetside, Birds Eye and Ordnance Survey.
26+
- Bing Maps Get a Static Map API supports getting a static map using coordinates, street address or place name as the location input. Azure Maps Get Map Static Image API supports only coordinates as the location input.
27+
- Bing Maps Get a Static Map API supports getting a static map of a driving, walking, or transit route natively. Azure Maps Get Map Static Image API doesn't provide route map functionality natively.
28+
- Bing Maps Get a Static Map API provides static maps in PNG, JPEG and GIF image formats. Azure Maps Get Map Static Image API provides static maps in PNG and JPEG image formats.
29+
- Bing Maps Get a Static Map API supports XML and JSON response formats. Azure Maps Get Map Static Image API supports only JSON response format.
30+
- Bing Maps Get a Static Map API supports HTTP GET and POST requests. Azure Maps Get Map Static Image API supports HTTP GET requests.
31+
- Bing Maps Get a Static Map API uses coordinates in the latitude & longitude format. Azure Maps Get Map Static Image API uses coordinates in the longitude & latitude format, as defined in [GeoJSON].
32+
- Unlike Bing Maps for Enterprise, Azure Maps is a global service that supports specifying a geographic scope, which allows you to limit data residency to the European (EU) or United States (US) geographic areas (geos). All requests (including input data) are processed exclusively in the specified geographic area. For more information, see [Azure Maps service geographic scope].
33+
34+
## Security and authentication
35+
36+
Bing Maps for Enterprise only supports API key authentication. Azure Maps supports multiple ways to authenticate your API calls, such as a [subscription key](azure-maps-authentication.md#shared-key-authentication), [Microsoft Entra ID], and [Shared Access Signature (SAS) Token]. For more information on security and authentication in Azure Maps, See [Authentication with Azure Maps] and the [Security] section in the Azure Maps Get Map Static Image documentation.
37+
38+
## Request parameters
39+
40+
The following table lists the Bing Maps _Get a Static Map_ request parameters and the Azure Maps equivalent:
41+
42+
| Bing Maps request parameter| Parameter Alias  | Azure Maps request parameter | Required in Azure Maps  | Azure Maps data type  | Description  |
43+
|----------------------------|------------------|------------------------------|----------------------------|-----------------------|--------------|
44+
| centerPoint | | center | True (if not using bbox) | number[] | Bing Maps Get a Static Map API requires coordinates be in latitude & longitude format, whereas Azure Maps Get Map Static Image API requires longitude & latitude format, as defined in the [GeoJSON] format. <br><br>`longitude,latitude` range from [-90, 90]​. Note: Either `center` or `bbox` are required parameters. They're mutually exclusive. |
45+
| culture | c | language | FALSE | String | In Azure Maps Get Map Static Image API, this is the language in which search results should be returned and is specified in the Azure Maps [request header]. For more information, see [Supported Languages]. |
46+
| declutterPins | dcl | Not supported   | Not supported | Not supported | |
47+
| dpi | dir | Not supported | Not supported | Not supported | |
48+
| drawCurve | dv | Path | FALSE | String | |
49+
| fieldOfView | fov | Not supported | Not supported | Not supported | In Bing Maps, this parameter is used for `imagerySet` Birdseye, `BirdseyeWithLabels`, `BirdseyeV2`, `BirdseyeV2WithLabels`, `OrdnanceSurvey`, `Streetside`. Azure Maps doesn't support these maps styles. |
50+
| format | fmt | format | TRUE | String | Bing Maps Get a Static Map API provides static maps in PNG, JPEG and GIF image formats. Azure Maps Get Map Static Image API provides static maps in PNG and JPEG image formats. |
51+
| heading | | Not supported | Not supported | Not supported | In Bing Maps, this parameter is used for imagerySet Birdseye, BirdseyeWithLabels, BirdseyeV2, BirdseyeV2WithLabels, OrdnanceSurvey, Streetside. Azure Maps doesn't support these maps styles. |
52+
| highlightEntity | he | Not supported | Not supported | Not supported | In Bing Maps Get a Static Map API, this parameter is used to get a polygon of the location input (entity) displayed on the map natively. Azure Maps Get a Map Static Image API doesn't support this feature, however, you can get a polygon of a location (locality) from the Azure Maps [Get Polygon] API and then display that on the static map. |
53+
| imagerySet | | tilesetID | TRUE | [TilesetId] | |
54+
| mapArea | ma | bbox | True (if not using center) | number[] | A bounding box, defined by two longitudes and two latitudes, represents the four sides of a rectangular area on the Earth, in the format of `minLon, minLat, maxLon, maxLat`. <br><br>Note: Either `center` or `bbox` are required parameters. They're mutually exclusive. `bbox` shouldn’t be used with `height` or `width`. |
55+
| mapLayer | ml | trafficLayer | FALSE | TrafficTilesetId | Optional. If `TrafficLayer` is provided, it returns map image with corresponding traffic layer. For more information, see [tilesetId]. |
56+
| mapSize | ms | height | TRUE | integer int32 | |
57+
| | | width | | | |
58+
| mapMetadata | mmd | Not supported | Not supported | Not supported | |
59+
| orientation | dir | Not supported | Not supported | Not supported | In Bing Maps Get a Static Map API, this parameter is used for 'imagerySet' Birdseye, BirdseyeWithLabels, BirdseyeV2, BirdseyeV2WithLabels, OrdnanceSurvey, Streetside. Azure Maps doesn't support these maps styles |
60+
| pitch | | Not supported | Not supported | Not supported | In Bing Maps Get a Static Map API, this parameter is used for 'imagerySet' Birdseye, BirdseyeWithLabels, BirdseyeV2, BirdseyeV2WithLabels, OrdnanceSurvey, Streetside. Azure Maps doesn't support these maps styles |
61+
| pushpin | pp | pins | FALSE | String | In Bing Maps Get a Static Map API, an HTTP GET request is limited to 18 pins and an HTTP POST request is limited to 100 pins per static map. Azure Maps Get Map Static Image API HTTP GET request doesn’t have a limit on the number of pins per static map. However, the number of pins supported on the static map is based on the maximum number of characters supported in the HTTP GET request. See Azure Maps Get Map Static Image API ‘pins’ parameter in [URI Parameters] for more details on pushpin support. |
62+
| query | | Not supported | Not supported | Not supported | Azure Maps Get Map Static Image API supports only coordinates as the location input, not street address or place name. Use the Azure Maps Get Geocoding API to convert a street address or place name to coordinates. |
63+
| Route Parameters: avoid | None | Not supported | Not supported | Not supported | Azure Maps Get Maps Static Image API doesn’t provide route map functionality natively. To get a static map with a route path on it, use the Azure Maps [Get Route Directions] or [Post Route Directions] API to get route path coordinates of a given route and then use the Azure Maps [Get Map Static Image] API `drawCurve` feature to overlay the route path coordinates on the static map. |
64+
| Route Parameters: distanceBeforeFirstTurn | dbft | Not supported | Not supported | Not supported | Azure Maps Get Maps Static Image API doesn’t provide route map functionality natively. To get a static map with a route path on it, you can use the Azure Maps [Get Route Directions] or [Post Route Directions] API to get route path coordinates of a given route and then use the Azure Maps [Get Map Static Image] API `drawCurve` feature to overlay the route path coordinates on the static map. |
65+
| Route Parameters: dateTime | dt | Not supported | Not supported | Not supported | Azure Maps Get Maps Static Image API doesn’t provide route map functionality natively. To get a static map with a route path on it, you can use the Azure Maps [Get Route Directions] or [Post Route Directions] API to get route path coordinates of a given route and then use the Azure Maps [Get Map Static Image] API `drawCurve` feature to overlay the route path coordinates on the static map. |
66+
| Route Parameters: maxSolutions | maxSolns | Not supported | Not supported | Not supported | Azure Maps Get Maps Static Image API doesn’t provide route map functionality natively. To get a static map with a route path on it, you can use the Azure Maps [Get Route Directions] or [Post Route Directions] API to get route path coordinates of a given route and then use the Azure Maps [Get Map Static Image] API `drawCurve` feature to overlay the route path coordinates on the static map. |
67+
| Route Parameters: optimize | optmz | Not supported | Not supported | Not supported | Azure Maps Get Maps Static Image API doesn’t provide route map functionality natively. To get a static map with a route path on it, you can use the Azure Maps [Get Route Directions] or [Post Route Directions] API to get route path coordinates of a given route and then use the Azure Maps [Get Map Static Image] API `drawCurve` feature to overlay the route path coordinates on the static map. |
68+
| Route Parameters: timeType | tt | Not supported | Not supported | Not supported | Azure Maps Get Maps Static Image API doesn’t provide route map functionality natively. To get a static map with a route path on it, you can use the Azure Maps [Get Route Directions] or [Post Route Directions] API to get route path coordinates of a given route and then use the Azure Maps [Get Map Static Image] API `drawCurve` feature to overlay the route path coordinates on the static map. |
69+
| Route Parameters: travelMode | None | Not supported | Not supported | Not supported | Azure Maps Get Maps Static Image API doesn’t provide route map functionality natively. To get a static map with a route path on it, you can use the Azure Maps [Get Route Directions] or [Post Route Directions] API to get route path coordinates of a given route and then use the Azure Maps [Get Map Static Image] API `drawCurve` feature to overlay the route path coordinates on the static map. |
70+
| Route Parameters: waypoint.n | wp.n | Not supported | Not supported | Not supported | Azure Maps Get Maps Static Image API doesn’t provide route map functionality natively. To get a static map with a route path on it, you can use the Azure Maps [Get Route Directions] or [Post Route Directions] API to get route path coordinates of a given route and then use the Azure Maps [Get Map Static Image] API `drawCurve` feature to overlay the route path coordinates on the static map. |
71+
| style | st | Not supported | Not supported | Not supported | |
72+
| userRegion | ur | view | FALSE | String | A string that represents an [ISO 3166-1 Alpha-2 region/country code]. This alters geopolitical disputed borders and labels to align with the specified user region. By default, the View parameter is set to “Auto” even if not defined in the request. For more information, see [Supported Views]. |
73+
| zoomLevel | | Zoom | FALSE | String | Desired zoom level of the map. Zoom value must be in the range: 0-20 (inclusive). Default value is 12. |
74+
| highlightEntity | he | Not supported | Not supported | Not supported | In Bing Maps Get a Static Map API, this parameter is used to get a polygon of the location input (entity) displayed on the map natively. Azure Maps Get a Map Static Image API doesn't support this feature, however, you can get a polygon of a location (locality) from the Azure Maps [Get Polygon] API and then display that on the static map. |
75+
76+
For more information about the Azure Maps Get Map Static Image API request parameters, see [URI Parameters].
77+
78+
## Request examples
79+
80+
Bing Maps _Get a Static Map_ API sample GET request:
81+
82+
``` http
83+
https://dev.virtualearth.net/REST/v1/Imagery/Map/Road/51.504810,-0.113629/15?mapSize=500,500&pp=51.504810,-0.113629;45&key={BingMapsKey}
84+
```
85+
86+
Azure Maps _Get Map Static Image_ API sample GET request:
87+
88+
``` http
89+
https://atlas.microsoft.com/map/static?api-version=2024-04-01&tilesetId=microsoft.base.road&zoom=15&center=-0.113629,51.504810&subscription-key={Your-Azure-Maps-Subscription-key}
90+
```
91+
92+
## Response examples
93+
94+
The following screenshot shows what is returned in the body of the HTTP response when executing the Bing Maps _Get a Static Map_ request:
95+
96+
:::image type="content" source="./media/migration-guides/bing-maps-get-static-map.png" alt-text="A screenshot of the map displaying the results of the Bing Maps Get a Static Map request." lightbox="./media/migration-guides/bing-maps-get-static-map.png":::
97+
98+
The following JSON sample shows what is returned in the body of the HTTP response when executing an Azure Maps _Get Map Static Image_ request:
99+
100+
:::image type="content" source="./media/migration-guides/azure-maps-get-map-static-image.png" alt-text="A screenshot of the map displaying the results of the Azure Maps Get Map Static Image request." lightbox="./media/migration-guides/azure-maps-get-map-static-image.png":::
101+
102+
## Transactions usage
103+
104+
Like Bing Maps Get a Static Map API, Azure Maps Get Map Static Image API logs one billable transaction per request. For more information on Azure Maps transactions, see [Understanding Azure Maps Transactions].
105+
106+
## Additional information
107+
108+
- [Render custom data on a raster map]
109+
110+
Support
111+
112+
- [Microsoft Q&A Forum]
113+
114+
[Authentication with Azure Maps]: azure-maps-authentication.md
115+
[Azure Account]: https://azure.microsoft.com/
116+
[Azure Maps account]: quick-demo-map-app.md#create-an-azure-maps-account
117+
[Azure Maps service geographic scope]: geographic-scope.md
118+
[GeoJSON]: https://geojson.org
119+
[Get a Static Map]: /bingmaps/rest-services/imagery/get-a-static-map
120+
[Get Map Static Image]: /rest/api/maps/render/get-map-static-image
121+
[Get Polygon]: /rest/api/maps/search/get-polygon
122+
[Get Route Directions]: /rest/api/maps/route/get-route-directions
123+
[ISO 3166-1 Alpha-2 region/country code]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
124+
[Microsoft Entra ID]: azure-maps-authentication.md#microsoft-entra-authentication
125+
[Microsoft Q&A Forum]: /answers
126+
[Post Route Directions]: /rest/api/maps/route/post-route-directions
127+
[Render custom data on a raster map]: how-to-render-custom-data.md
128+
[request header]: /rest/api/maps/render/get-map-static-image?#request-headers
129+
[Security]: /rest/api/maps/render/get-map-static-image#security
130+
[Shared Access Signature (SAS) Token]: azure-maps-authentication.md#shared-access-signature-token-authentication
131+
[subscription key]: quick-demo-map-app.md#get-the-subscription-key-for-your-account
132+
[Supported Languages]: supported-languages.md
133+
[Supported Views]: supported-languages.md#azure-maps-supported-views
134+
[TilesetId]: /rest/api/maps/render/get-map-static-image#tilesetid
135+
[Understanding Azure Maps Transactions]: understanding-azure-maps-transactions.md
136+
[URI Parameters]: /rest/api/maps/render/get-map-static-image#uri-parameters

articles/azure-maps/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ items:
106106
items:
107107
- name: Get Imagery Metadata
108108
href: migrate-get-imagery-metadata.md
109+
- name: Get a Static Map
110+
href: migrate-get-static-map.md
109111
- name: Bing Maps Locations Services
110112
items:
111113
- name: Find a Location by Address

0 commit comments

Comments
 (0)