Created
June 17, 2019 14:48
-
-
Save densa/360e262974214098f8a783cece7e2b0e to your computer and use it in GitHub Desktop.
This file contains 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
function getMapBounds(region) { | |
var b = {}; | |
b.northWest = {}; b.northEast = {}; | |
b.southWest = {}; b.southEast = {}; | |
b.northWest.lat = parseFloat(region.latitude) + | |
parseFloat(region.latitudeDelta) / 2.0; | |
b.northWest.lng = parseFloat(region.longitude) - | |
parseFloat(region.longitudeDelta) / 2.0; | |
b.southWest.lat = parseFloat(region.latitude) - | |
parseFloat(region.latitudeDelta) / 2.0; | |
b.southWest.lng = parseFloat(region.longitude) - | |
parseFloat(region.longitudeDelta) / 2.0; | |
b.northEast.lat = parseFloat(region.latitude) + | |
parseFloat(region.latitudeDelta) / 2.0; | |
b.northEast.lng = parseFloat(region.longitude) + | |
parseFloat(region.longitudeDelta) / 2.0; | |
b.southEast.lat = parseFloat(region.latitude) - | |
parseFloat(region.latitudeDelta) / 2.0; | |
b.southEast.lng = parseFloat(region.longitude) + | |
parseFloat(region.longitudeDelta) / 2.0; | |
return b; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment