Skip to content

Instantly share code, notes, and snippets.

@delineas
Last active October 3, 2021 18:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delineas/256de15827febcff6e53446206cb726c to your computer and use it in GitHub Desktop.
Save delineas/256de15827febcff6e53446206cb726c to your computer and use it in GitHub Desktop.
Reverse Geocoding
// From https://developer.here.com/api-explorer/rest/geocoder/reverse-geocode
$.ajax({
url: 'https://reverse.geocoder.api.here.com/6.2/reversegeocode.json',
type: 'GET',
dataType: 'jsonp',
jsonp: 'jsoncallback',
data: {
prox: '39.2134,10.0956,250721',
mode: 'retrieveAddresses',
maxresults: '1',
gen: '9',
app_id: 'devportal-demo-20180625',
app_code: '9v2BkviRwi9Ot26kp2IysQ'
},
success: function (data) {
console.log(JSON.stringify(data));
}
});
/*
* @param {H.service.Platform} platform
*/
function reverseGeocode(platform) {
var geocoder = platform.getGeocodingService(),
parameters = {
prox: '39.2134,10.0956,250721',
mode: 'retrieveAddresses',
maxresults: '1',
gen: '9'};
geocoder.reverseGeocode(parameters,
function (result) {
alert(result);
}, function (error) {
alert(error);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment