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

Make LatLngBounds obey its argument order #2414

Merged
merged 2 commits into from Aug 23, 2016
Merged

Make LatLngBounds obey its argument order #2414

merged 2 commits into from Aug 23, 2016

Conversation

tmcw
Copy link
Contributor

@tmcw tmcw commented Apr 8, 2016

fixes #2415

@lucaswoj
Copy link
Contributor

Could you provide a little more context for this PR? What do you mean by "obey its argument order"? Can you demonstrate the behavior with a unit test?

@tmcw
Copy link
Contributor Author

tmcw commented Apr 19, 2016

See the referenced issue #2415 for the details

return obj ? this.setNE(LngLat.convert(obj) || LngLatBounds.convert(obj)) : this;
}
this._ne = new LngLat(ne2.lng, ne2.lat);
return this;
Copy link
Contributor

@lucaswoj lucaswoj Apr 26, 2016

Choose a reason for hiding this comment

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

Could this code be rewritten as 👇?

setNE: function(ne) {
    if (!ne) return this;
    ne = LngLat.convert(ne) || LngLatBounds.convert(ne);
    this._ne = new LngLat(ne.lng, ne.lat);
    return this;
}

@lucaswoj
Copy link
Contributor

Refactored and fixed failing unit tests.

There are some unit test "expected value" updates that raise a red flag in my head.

@mourner @morganherlocker What do yout think about these changes? How painful will this breaking change be to our users?

@mourner
Copy link
Member

mourner commented Aug 22, 2016

@lucaswoj not sure how many people used the reverse order for the bounds, but it's easy to upgrade at least.

@lucaswoj
Copy link
Contributor

@mourner Sounds good to me. Is this ready to 🚢?

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.

Allow "fitBounds" to span the date line
4 participants