Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@hufeng
Created December 20, 2018 03:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hufeng/42a900bb38be2ce16839628ac398099b to your computer and use it in GitHub Desktop.
Save hufeng/42a900bb38be2ce16839628ac398099b to your computer and use it in GitHub Desktop.
随机生成南京范围经纬度
function getRandomArbitrary(min, max) {
return Math.random() * (max - min) + min;
}
//南京经纬度范围
//经度范围:118.35-119.233
//维度范围:31.236-32.611
/**
* 南京经度随机
*/
function getNJLgt() {
return getRandomArbitrary(118.35, 119.233);
}
/**
* 南京纬度随机
*/
function getNJLat() {
return getRandomArbitrary(31.236, 32.611);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment