-
Notifications
You must be signed in to change notification settings - Fork 16
Joe/add directions api #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new directions API to the Web SDK, providing route guidance functionality with step-by-step instructions. The implementation includes comprehensive type definitions for maneuvers and directions data structures, along with proper API integration.
Key changes:
- Added directions API endpoint with support for locations, travel mode, units, avoid options, and geometry
- Introduced comprehensive type definitions for directions responses including legs, steps, and maneuver types
- Added test coverage for the new directions functionality
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
src/types.ts | Defines RadarDirectionsParams, response interfaces, and maneuver types for the directions API |
src/api/routing.ts | Implements the directions method with parameter processing and HTTP request handling |
src/api.ts | Exposes the directions API as a public method on the main Radar class |
test/api/routing.test.ts | Adds test coverage for the directions API functionality |
Also reran tests with new types.
geometry, | ||
} = params; | ||
|
||
if( Array.isArray(locations) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit fix spacing ie
if (Array.isArray(locations)) {
}); | ||
|
||
describe( 'getDirections', () =>{ | ||
describe( 'all args given', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit fix spacing
import Radar from '../../src'; | ||
import Config from '../../src/config'; | ||
import { RadarOptions, RadarTravelMode } from '../../src/types'; | ||
import {Location, RadarOptions, RadarTravelMode} from '../../src/types'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit fix spacing ie
import { Location, RadarOptions, RadarTravelMode } from '../../src/types';
Added the directions API to the Web SDK.


Added a test and ran succesfully. Also showed the API working with all inputs in the console on the demo.
Reran tests w/ updated type descriptions:
