googlemaps / googlemaps/google-maps-services-js

Directions: Missing type "google.maps.DirectionsStatus" in "google.maps.DirectionsResult" OS:W11 Pro

Open
#1,173 1 comment 0 reactions 0 assignees View on GitHub
triage me type: bug
Dominant language
TypeScript
Stars
3.1k
Forks
654
Avg merge
3m
Merged PRs (30d)
4

Description

Property google.maps.DirectionsStatus is missing in the type google.maps.DirectionsResult

when i console.log the result it is in the object.

using latest version of @types/google.maps

```
const result = await DirectionsService.route(request)

//result.status throws typescript error: Property 'status' does not exist on type 'DirectionsResult'.ts(2339)
if (result.status === 'OK') {
DirectionsRenderer.setDirections(result)
}
```

Solution:

add following line:

`status: google.maps.DirectionsStatus;`

in the exported interface DirectionsResult (Line 1033 in index.d.ts)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.