-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Invalid type on LngLatBounds.extend #8065
Comments
|
@fc Thanks for the detailed issue, want to submit a PR? |
any updates on this? should |
We would welcome a PR contribution for the issue in the OP.
Could you please create a separate issue for this |
closed by #9293 |
It appears that
LngLatLike
andLngLatBoundsLike
should also be allowed since the convert methods used here accept those types:https://github.com/mapbox/mapbox-gl-js/blob/master/src/geo/lng_lat_bounds.js#L85-L91
I believe it is just a matter of changing it in the comments and in the type definition:
LngLat | LngLatBounds
toLngLat | LngLatBounds | LngLatLike | LngLatBoundsLike
, or to justLngLatLike | LngLatBoundsLike
- not sure off the top of my head if theinstanceof
call will needLngLat
to be explicitly set as a type (refer to lines 74 and 78).I haven't created a PR since I don't have the time to test right now....but should be enough info for someone to look into it.
mapbox-gl-js version:
Latest version
Expected Behavior
No type errors
Actual Behavior
Invalid types
Something like this will fail TypeScript type checks:
The text was updated successfully, but these errors were encountered: