Skip to content

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

@DarkNasuada

Description

@DarkNasuada

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions