@@ -97,7 +97,7 @@ routeType="eco"
97
97
constantSpeedConsumptionInkWhPerHundredkm= " 50,8.2:130,21.3"
98
98
99
99
# Get boundaries for the electric vehicle's reachable range.
100
- routeRangeResponse = await (await session.get(" https://atlas.microsoft.com/route/range/json?subscription-key={} &api-version=2025-01-01 &query={} &travelMode={} &vehicleEngineType={} ¤tChargeInkWh={} &maxChargeInkWh={} &timeBudgetInSec={} &routeType={} &constantSpeedConsumptionInkWhPerHundredkm={} "
100
+ routeRangeResponse = await (await session.get(" https://atlas.microsoft.com/route/range/json?subscription-key={} &api-version=1.0 &query={} &travelMode={} &vehicleEngineType={} ¤tChargeInkWh={} &maxChargeInkWh={} &timeBudgetInSec={} &routeType={} &constantSpeedConsumptionInkWhPerHundredkm={} "
101
101
.format(subscriptionKey,str (currentLocation[0 ])+ " ," + str (currentLocation[1 ]),travelMode, vehicleEngineType, currentChargeInkWh, maxChargeInkWh, timeBudgetInSec, routeType, constantSpeedConsumptionInkWhPerHundredkm))).json()
102
102
103
103
polyBounds = routeRangeResponse[" reachableRange" ][" boundary" ]
@@ -200,7 +200,7 @@ locationData = {
200
200
}
201
201
202
202
# Get the travel time and distance to each specified charging station.
203
- searchPolyRes = await (await session.post(url = " https://atlas.microsoft.com/route/matrix/json?subscription-key={} &api-version=2025-01-01 &routeType=shortest&waitForResults=true" .format(subscriptionKey), json = locationData)).json()
203
+ searchPolyRes = await (await session.post(url = " https://atlas.microsoft.com/route/matrix/json?subscription-key={} &api-version=1.0 &routeType=shortest&waitForResults=true" .format(subscriptionKey), json = locationData)).json()
204
204
205
205
distances = []
206
206
for dist in range (len (reachableLocations)):
@@ -218,7 +218,7 @@ After locating the nearest charging station, use the [Get Route Directions] API
218
218
219
219
``` python
220
220
# Get the route from the electric vehicle's current location to the closest charging station.
221
- routeResponse = await (await session.get(" https://atlas.microsoft.com/route/directions/json?subscription-key={} &api-version=2025-01-01 &query={} :{} " .format(subscriptionKey, str (currentLocation[0 ])+ " ," + str (currentLocation[1 ]), closestChargeLoc))).json()
221
+ routeResponse = await (await session.get(" https://atlas.microsoft.com/route/directions/json?subscription-key={} &api-version=1.0 &query={} :{} " .format(subscriptionKey, str (currentLocation[0 ])+ " ," + str (currentLocation[1 ]), closestChargeLoc))).json()
222
222
223
223
route = []
224
224
for loc in range (len (routeResponse[" routes" ][0 ][" legs" ][0 ][" points" ])):
0 commit comments