Skip to content

Instantly share code, notes, and snippets.

@fitomad
Created October 22, 2018 07:02
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 fitomad/868c1565b74dd678eb72dbe19999ef69 to your computer and use it in GitHub Desktop.
Save fitomad/868c1565b74dd678eb72dbe19999ef69 to your computer and use it in GitHub Desktop.
function addressFromCoordinate(coordinate)
{
let geocoder = new mapkit.Geocoder();
geocoder.reverseLookup(coordinate, function(error, data) {
let latitude = data.results[0].coordinate.latitude;
let longitude = data.results[0].coordinate.longitude;
let formattedAddress = data.results[0].formattedAddress;
console.log("Coordinates (%f, %f) == Address (%s)", latitude, longitude, formattedAddress);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment