Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect/missing types in Maps JavaScript API #62

Open
mrkesh opened this issue Sep 4, 2022 · 1 comment
Open

Incorrect/missing types in Maps JavaScript API #62

mrkesh opened this issue Sep 4, 2022 · 1 comment
Assignees
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@mrkesh
Copy link

mrkesh commented Sep 4, 2022

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.

@mrkesh mrkesh added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Sep 4, 2022
@jcesarmobile
Copy link

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

Types have BOUNCE: 0.0, DROP: 1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants