faker icon indicating copy to clipboard operation
faker copied to clipboard

Latitude and Longitude

Open axrs opened this issue 3 years ago • 1 comments

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;
}

axrs avatar Mar 25 '22 04:03 axrs

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 😊

drager avatar Mar 31 '22 05:03 drager

Fixed in #63

drager avatar Dec 07 '22 20:12 drager