How to use the longitude function from chance

Find comprehensive JavaScript chance.longitude code examples handpicked from public code repositorys.

26
27
28
29
30
31
32
33
34
35
    long_lim: [-180, 180],
    lat_lim: [-90, 90]
  })
);

var lng = chance.longitude({
  min: options.long_lim[0],
  max: options.long_lim[1]
});
var lat = chance.latitude({
fork icon21
star icon117
watch icon0

165
166
167
168
169
170
171
172
173
174

case 'latitude':
    s += chance.latitude();
    break;
case 'longitude':
    s += chance.longitude();
    break;

case 'mi': // middle initial
    s += chance.character({
fork icon2
star icon8
watch icon0

8
9
10
11
12
13
14
15
16
17
18
19
20
// Example: sudo docker exec -e apiaddress=pure-src-api-server:3000 -it PureSrc /usr/src/app/node_modules/.bin/mocha --ui tdd /usr/src/app/docker/dev/api-server/test/e2e/coordinates.js


var server = supertest.agent(process.env.apiaddress);


const lat = chance.latitude();
const lng = chance.longitude();


suite('Source', function () {
  const sourceService = new SourceService(server);
  let source = null;
fork icon2
star icon7
watch icon0

6
7
8
9
10
11
12
13
14
if (!lat) {
  lat = chance.latitude();
}

if (!lng) {
  lng = chance.longitude();
}

var sourceCoordinates = new SourceCoordinates({ lat, lng });
fork icon2
star icon7
watch icon0

7
8
9
10
11
12
13
14
15
16

for (var i = labels.length - 1; i >= 0; i--) {
    var label = labels[i];
    switch (label) {
        case "Tokyo": // Japan/Tokyo:
            return chance.longitude({
                min: 139.995,
                max: 140.005
            });
        case "Hong Kong": // China/HongKong
fork icon1
star icon0
watch icon0

+ 12 other calls in file

12
13
14
15
16
17
18
19
20
21
    country: 'US',
    region: chance.state(),
    eu: '0',
    timezone: chance.timezone().utc,
    city: chance.city(),
    ll: [chance.latitude(), chance.longitude()],
    metro: Math.floor(Math.random() * Math.floor(10000000)),
    area: Math.floor(Math.random() * Math.floor(10000))
  }
}));
fork icon0
star icon0
watch icon0