Created
December 20, 2018 03:54
-
-
Save hufeng/42a900bb38be2ce16839628ac398099b 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 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