Skip to content

Update "Route to a destination" sample to use new Azure Maps API version 2025-01-01#183

Merged
dubiety merged 2 commits intomainfrom
copilot/fix-180
Jul 11, 2025
Merged

Update "Route to a destination" sample to use new Azure Maps API version 2025-01-01#183
dubiety merged 2 commits intomainfrom
copilot/fix-180

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jul 11, 2025

The "Route to a destination" tutorial sample was using the deprecated Azure Maps Route API version 1.0, which is scheduled for retirement. This PR updates the sample to use the current API version 2025-01-01 with the new POST-based methodology.

Changes Made

API Version Update

  • Before: api-version=1.0 (deprecated)
  • After: api-version=2025-01-01 (current)

HTTP Method Change

  • Before: GET request with query parameters
  • After: POST request with JSON body

URL Structure

  • Before: https://{azMapsDomain}/route/directions/json?api-version=1.0&query={query}&routeRepresentation=polyline&travelMode=car&view=Auto
  • After: https://{azMapsDomain}/route/directions?api-version=2025-01-01

Request Format

  • Before: Query string format (startLat,startLon:endLat,endLon)
  • After: GeoJSON FeatureCollection with waypoint features

Implementation Details

  • Replaced processRequest() with processPostRequest()
  • Added required pointIndex and pointType: "waypoint" properties to route points
  • Included route optimization options: optimizeRoute, routeOutputOptions, maxRouteCount, travelMode
  • Simplified response processing by directly adding returned GeoJSON to data source

The sample now follows the current Azure Maps Route API standards and will continue working when the deprecated API version is retired.

Updated sample interface

Fixes #180.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…1 with POST method

Co-authored-by: dubiety <3462778+dubiety@users.noreply.github.com>
Copilot AI changed the title [WIP] "Route to a destination" sample uses deprecated API version Update "Route to a destination" sample to use new Azure Maps API version 2025-01-01 Jul 11, 2025
Copilot AI requested a review from dubiety July 11, 2025 01:34
Copy link
Copy Markdown
Contributor

@dubiety dubiety left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dubiety dubiety marked this pull request as ready for review July 11, 2025 01:56
@dubiety dubiety merged commit cdf6c36 into main Jul 11, 2025
1 check passed
@dubiety dubiety deleted the copilot/fix-180 branch July 11, 2025 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Route to a destination" sample uses deprecated API version

2 participants