Created
December 2, 2019 19:43
-
-
Save duanebester/ec69332f0405f55dec97ae817a8e3355 to your computer and use it in GitHub Desktop.
Map Bounds To Bbox Utility
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
const mapBoundsToBbox = bounds => { | |
const northWest = bounds.getNorthWest(); | |
const southEast = bounds.getSouthEast(); | |
const topLeft = { | |
lat: `${northWest.lat}`, | |
lon: `${northWest.lng}` | |
}; | |
const bottomRight = { | |
lat: `${southEast.lat}`, | |
lon: `${southEast.lng}` | |
}; | |
return { | |
topLeft, | |
bottomRight | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment