googlemaps / js-types

Automatically generated types for the Google Maps Platform JavaScript API
Apache License 2.0
8 stars 7 forks source link

Incorrect/missing types in Maps JavaScript API #62

Open mrkesh opened 2 years ago

mrkesh commented 2 years ago

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.

jcesarmobile commented 1 year ago

same for google.maps.Animation, js values are BOUNCE: 1, DROP: 2, XA: 3, TA: 4

Types have BOUNCE: 0.0, DROP: 1.0