Last active
May 15, 2017 02:13
-
-
Save oliverbenns/a2b3598e21f80fd8a12ae27f3110793d to your computer and use it in GitHub Desktop.
Google Map Area (Square) Calculator
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
const lngRadius = 0.25; | |
const point = { | |
lat: 51.507351, | |
lng: -0.127758, | |
}; | |
const latmin = point.lat - lngRadius; | |
const latmax = point.lat + lngRadius; | |
const lngmin = point.lng - (lngRadius / 85 * 180); // Number of units different from lng so need to calculate | |
const lngmax = point.lng + (lngRadius / 85 * 180); | |
// min | |
console.log(`${latmin}, ${lngmin}`) | |
// max | |
console.log(`${latmax}, ${lngmax}`) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment