WIP
This commit is contained in:
parent
108fdac4e0
commit
5947ea7eb8
@ -27,11 +27,6 @@
|
||||
return data.countryCode;
|
||||
}
|
||||
};
|
||||
function getSurroundings (location) {
|
||||
const meters = 100;
|
||||
const R_EARTH = 6378.137;
|
||||
const M = 1 / (((2 * Math.PI) / 360) * R_EARTH) / 1000;
|
||||
|
||||
function moveFrom(coords, angle, distance) {
|
||||
let radianAngle = (angle * Math.PI) / 180;
|
||||
let x = 0 + distance * Math.cos(radianAngle);
|
||||
@ -40,6 +35,10 @@
|
||||
let newLng = coords.lng + (x * M) / Math.cos(coords.lat * (Math.PI / 180));
|
||||
return { lat: newLat, lng: newLng };
|
||||
}
|
||||
function getSurroundings (location) {
|
||||
const meters = 100;
|
||||
const R_EARTH = 6378.137;
|
||||
const M = 1 / (((2 * Math.PI) / 360) * R_EARTH) / 1000;
|
||||
let coordinates = [location];
|
||||
for (let angle = 0; angle < 360; angle += 45) {
|
||||
coordinates.push(moveFrom({ lat: location.lat, lng: location.lng }, angle, meters));
|
||||
|
Loading…
x
Reference in New Issue
Block a user