Add ne and sw to bounds object by sleekybadger · Pull Request #287 · google-map-react/google-map-react
Hi, thanks for the great library it serving to me faithfully not first time.
I found small problem with bounds object, most geo tools expect to receive data with NE and SW, instead of NW and SE. So i thought it will be cool if bounds object will contain all corners.
All is fine, may be add ability to use NE SW (if NW SE is not provided) to documented fitBounds ?
@istarkov It's make sense, what do you think about such approach:
- If we have NW and SE we're just using them.
- If we have NE and SW we're converting them into NW and SE and using same algorithm that we have in
fitBoundsmethod.
@istarkov cool, i'll push changes tomorrow morning
@istarkov hm, I thought a little bit about it today, and i don't really like that we're passing NE and SW to fitBounds, but it returns NW and SE. What do you think about it?
Also i think will can add some helpers like convertNeSwToNwSe and convertNwSeToNeSw, cause we're repeating this logic in few places.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be we will remove const exports = and all that this below, as it was time when export default { blabla } was the same as export const blabla
Having that it was deprecated in babel there is no need in exports object at all.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that part seemed strange to me) Sure.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Super,
from first days I had knowledge that bounds object is not similar to others API
(and my laziness didn't allow me to fix that)
all that my
const ne = { lat: nw.lat, lng: se.lng };
const sw = { lat: se.lat, lng: nw.lng };
return new LatLngBounds(sw, ne);
now will gone ;-)
Thank you a lot!!!!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
lock
bot
locked as resolved and limited conversation to collaborators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters