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

extend method does not accept LngLatLike or LngLatBoundsLike obj #9787

Open
danikas2k2 opened this issue Jun 14, 2020 · 5 comments
Open

extend method does not accept LngLatLike or LngLatBoundsLike obj #9787

danikas2k2 opened this issue Jun 14, 2020 · 5 comments
Labels
needs investigation 🔍 Issues that require further research (e.g. it's not clear whether it's GL JS or something else)

Comments

@danikas2k2
Copy link

extend(obj: LngLatLike | LngLatBoundsLike) {

extend method is described to accept LngLatLike or LngLatBoundsLike types, but implementation accepts only "instanceof LngLat", "instanceof LngLatBounds" and "isArray(obj)".

Other object-like arguments are just skipped.

@ryanhamley
Copy link
Contributor

Can you provide an example of what isn't working? As of v1.9.0, extend does accept LngLatLike and LngLatBoundsLike.

@danikas2k2
Copy link
Author

Hi, I'm using v1.10.1.

The code is not working:

bounds.extend({lng: 10, lat: 10});

This simple object passed as an argument is LngLatLike, so method accept it. But for implementation it's neither instanceof LngLat, nor instanceof LngLatBounds, nor Array.isArray(obj), so no extension is made after all.

@zacharymorel
Copy link

I am also having the same issue.

@blq
Copy link

blq commented Jun 17, 2020

The test-cases I posted here shows the issue quite well:
#9293 (comment)

@ryanhamley ryanhamley added needs investigation 🔍 Issues that require further research (e.g. it's not clear whether it's GL JS or something else) and removed needs information 🙏 labels Jun 17, 2020
@ryanhamley
Copy link
Contributor

ryanhamley commented Jun 17, 2020

@sgolbabaei There appears to be some inconsistency with the way extend is handling *Like objects. Can you take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation 🔍 Issues that require further research (e.g. it's not clear whether it's GL JS or something else)
Projects
None yet
Development

No branches or pull requests

4 participants