Skip to content

Incorrect/missing types in Maps JavaScript API #62

@mrkesh

Description

@mrkesh

While converting some JS code to TS, I notice some discrepancies between the actual JS library and the types defined in @types/google.maps.

For instance, the google.maps.ControlPosition enum is defined here with a set of values, but if I console.log the real values I get something much different:

Screenshot 2022-09-04 at 16 13 51

This is an old issue, also referenced in another PR but that got fixed in other library rather than here for some reason.

Additionally, the values don't seem to match the documentation found on the website: https://developers.google.com/maps/documentation/javascript/reference/3.49/control#ControlPosition

Another (minor) issue I spotted is that we can invoke something like map.center but that is also not defined in the type definitions. map.center does the same as map.getCenter() and, while that can be easily replaced, it should also be easy to update the definitions to contain get center.

I am happy to create a PR or to investigate further discrepancies.

Please do let me know if you need more information.

Thanks.

Metadata

Metadata

Assignees

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