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

Added new function getBBoxCoordinates and updated readme #37

Merged
merged 3 commits into from Apr 5, 2020

Conversation

eyseman
Copy link
Contributor

@eyseman eyseman commented Apr 4, 2020

Hi,

I just came into a situation where I needed all four corners of the bounding box, i.e. to work with geospatial queries in MongoDB. Thus, I added a new function, which returns an object that contains the coordinate pairs of all four corners. I also updated the readme to show, how to call it.

I hope this can be useful to the crowd.

Thanks!

Cheers,
Tom

This function provides, in comparison to the getBounds() function, all four corners of the bounding box. This can be useful, if you are dealing with geospatial queries in MongoDB, e.g., $geoWithin, in combination of using a polygon instead of the classical bbox.
added a short example of how to use the getBBoxCoordinates() function
Introduced fix to remove the following warning, due to deprecation of old inheritance method
"Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead. Error"
@heyman
Copy link
Owner

heyman commented Apr 5, 2020

Nice!

@heyman heyman merged commit 1afaf21 into heyman:master Apr 5, 2020
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.

None yet

2 participants