@stadiamaps/api
Advanced tools
Changelog
Version 5.0.0 - 2024-09-04
isRouteResponse
and isOsrmRouteResponse
helper functions as these were duplicated.You can migrate to the equivalent instanceOfRouteResponse
and instanceOfOsrmRouteResponse
methods.
Changelog
Version 4.0.0 - 2024-09-04
TypeScript users will need to use a type guard in order to check the type of the response for directions APIs, as the response type is now a union. The response format will depend on the value of the format parameter in your request.
Here is an example of how to do the check in your code. The guard helper function is included in this SDK and exported publicly.
const res = await api.route({ routeRequest: routeRequest });
if (instanceOfRouteResponse(res)) {
// TODO: Process the response
} else {
fail("Expected a Valhalla JSON format route response");
}
Alternately, you can guard for OSRM format responses like this:
const res = await api.route({ routeRequest: osrmFormatRouteRequest });
if (instanceOfOsrmRouteResponse(res)) {
// TODO: Process the response
} else {
fail("Expected an OSRM format route response");
}
Changelog
Version 3.2.2 - 2024-08-16
Changelog
Version 3.2.1 - 2024-08-15
Changelog
Version 3.2.0 - 2024-07-31
Changelog
Version 3.1.0 - 2024-05-11
Changelog
Version 3.0.0 - 2024-04-30
Changelog
Version 2.1.0 - 2024-03-21
ignore_
options for ignoring various restrictions (useful for certain map matching applications)webpack
tree shakingChangelog
Version 2.0.0 - 2024-03-19
Changelog
Version 1.0.10 - 2023-12-08