drager/faker

Latitude and Longitude

axrs opened this issue · 2 comments

axrs commented

It would be nice if Faker had support for creating Latitude and Longitude values.

Something to this effect should work, with faker being the current instance instead of the global.

It might sit under faker.address.latitude/faker.address.longitude or even faker.geospatial.latitude/faker.geospatial.longitude ?

double longitude() {
  return -180 + faker.randomGenerator.decimal() * 180 * 2;
}

double latitude() {
  return -90 + faker.randomGenerator.decimal() * 90 * 2;
}

Sounds great to include it. I think the best would be to put it under geolocation, geo or geospatial. Feel free to send a PR 😊

Fixed in #63