Skip to content

Commit b702bf6

Browse files
committed
Updated call to Get Map Static Image
1 parent cf2f853 commit b702bf6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

articles/azure-maps/tutorial-ev-routing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ pins = "custom|an15 53||{}||https://raw.githubusercontent.com/Azure-Samples/Azur
172172
encodedPins = urllib.parse.quote(pins, safe='')
173173

174174
# Render the range and electric vehicle charging points on the map.
175-
staticMapResponse = await session.get("https://atlas.microsoft.com/map/static/png?api-version=2024-04-01&subscription-key={}&pins={}&path={}&bbox={}&zoom=12".format(subscriptionKey,encodedPins,path,str(minLon)+", "+str(minLat)+", "+str(maxLon)+", "+str(maxLat)))
175+
staticMapResponse = await session.get("https://atlas.microsoft.com/map/static?api-version=2024-04-01&subscription-key={}&pins={}&path={}&bbox={}&zoom=12".format(subscriptionKey,encodedPins,path,str(minLon)+", "+str(minLat)+", "+str(maxLon)+", "+str(maxLat)))
176176

177177
poiRangeMap = await staticMapResponse.content.read()
178178

@@ -260,7 +260,7 @@ minLat -= latBuffer
260260
maxLat += latBuffer
261261

262262
# Render the route on the map.
263-
staticMapResponse = await session.get("https://atlas.microsoft.com/map/static/png?api-version=2024-04-01&subscription-key={}&&path={}&pins={}&bbox={}&zoom=16".format(subscriptionKey,path,pins,str(minLon)+", "+str(minLat)+", "+str(maxLon)+", "+str(maxLat)))
263+
staticMapResponse = await session.get("https://atlas.microsoft.com/map/static?api-version=2024-04-01&subscription-key={}&&path={}&pins={}&bbox={}&zoom=16".format(subscriptionKey,path,pins,str(minLon)+", "+str(minLat)+", "+str(maxLon)+", "+str(maxLat)))
264264

265265
staticMapImage = await staticMapResponse.content.read()
266266

articles/azure-maps/weather-service-tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ for i in range(0, len(coords), 2):
109109
wind_direction.append([])
110110

111111
query = str(coords[i])+', '+str(coords[i+1])
112-
forecast_response = await(await session.get("https://atlas.microsoft.com/weather/forecast/daily/json?query={}&api-version=1.0&subscription-key={Your-Azure-Maps-Subscription-key}&duration=15".format(query, subscription_key))).json()
112+
forecast_response = await(await session.get("https://atlas.microsoft.com/weather/forecast/daily/json?query={}&api-version=1.0&subscription-key={}&duration=15".format(query, subscription_key))).json()
113113
j+=1
114114
for day in range(len(forecast_response['forecasts'])):
115115
date = forecast_response['forecasts'][day]['date'][:10]
@@ -134,7 +134,7 @@ session = aiohttp.ClientSession()
134134

135135
pins="default|la-25+60|ls12|lc003C62|co9B2F15||'Location A'{} {}|'Location B'{} {}|'Location C'{} {}|'Location D'{} {}".format(coords[1],coords[0],coords[3],coords[2],coords[5],coords[4], coords[7],coords[6])
136136

137-
image_response = "https://atlas.microsoft.com/map/static/png?subscription-key={Your-Azure-Maps-Subscription-key}&api-version=2024-04-01&layer=basic&style=main&zoom=6&center={},{}&pins={}".format(subscription_key,coords[7],coords[6],pins)
137+
image_response = "https://atlas.microsoft.com/map/static?subscription-key={}&api-version=2024-04-01&layer=basic&style=main&zoom=6&center={},{}&pins={}".format(subscription_key,coords[7],coords[6],pins)
138138

139139
static_map_response = await session.get(image_response)
140140

0 commit comments

Comments
 (0)