Skip to content

Instantly share code, notes, and snippets.

@bhousel
Created March 15, 2015 19:29
Show Gist options
  • Save bhousel/05be464d7f53c95c4eab to your computer and use it in GitHub Desktop.
Save bhousel/05be464d7f53c95c4eab to your computer and use it in GitHub Desktop.
Where am I (Nominatim lookup) #iD
// https://github.com/twain47/Nominatim/blob/master/lib/ReverseGeocode.php
function whereami(z) {
var endpoint = 'https://nominatim.openstreetmap.org/reverse?',
loc = id.map().center();
d3.json(endpoint +
iD.util.qsString({format: 'json', addressdetails: 1, lat: loc[1], lon: loc[0], zoom: z }),
function(err, result) { console.info(result); }
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment