Skip to content

Conversation

JoRoRadar
Copy link
Contributor

@JoRoRadar JoRoRadar commented Aug 6, 2025

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.
Screenshot 2025-08-06 at 10 31 45 AM
Screenshot 2025-08-06 at 10 31 06 AM

Reran tests w/ updated type descriptions:
Screenshot 2025-08-13 at 4 18 57 PM

@JoRoRadar JoRoRadar requested review from Copilot, kochis and lmeier and removed request for Copilot August 6, 2025 14:32
@kochis kochis requested review from jaspk06 and boonboonsiri August 6, 2025 15:48
@Copilot Copilot AI review requested due to automatic review settings August 6, 2025 19:38
Copy link

@Copilot Copilot AI left a 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

@JoRoRadar JoRoRadar requested a review from kochis August 7, 2025 14:10
Also reran tests with new types.
@JoRoRadar JoRoRadar requested a review from jaspk06 August 13, 2025 20:20
geometry,
} = params;

if( Array.isArray(locations) ) {
Copy link
Contributor

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', () => {
Copy link
Contributor

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';
Copy link
Contributor

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';

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.

4 participants