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

Add mapboxgl.LngLatBounds.isEmpty() method #5917

Merged
merged 2 commits into from Jan 2, 2018
Merged

Add mapboxgl.LngLatBounds.isEmpty() method #5917

merged 2 commits into from Jan 2, 2018

Conversation

ghost
Copy link

@ghost ghost commented Dec 26, 2017

Current behavior: Calling toArray() on a null-type bbox throws an exception instead of returning an empty array ("undefined this._sw doesn't have a toArray() method"). To check if bounds are defined the user needs to inspect internal properties.

Proposed solution: This PR adds a handy isEmpty() method to the public interface, for checking if bounds are defined (similar to the Google Maps LatLngBounds.isEmpty() that many are used to having).

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • document any changes to public APIs

Copy link
Contributor

@jfirebaugh jfirebaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vtepliuk!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants