I am looking for an API. Preferably a JSONP API (client side)
Asked
Active
Viewed 242 times
1 Answers
0
Not a JSONP but you can manipulate this as you want. I am using Google Map API client-side.
var lat = 'some value';
var lng = 'some value';
geomap.geocode({'latLng':new google.map.latLng(lat,lng)},function(res){
var tmp = [];
$.each(res,function(i,e){
if(e.address_components.length>=4){
tmp.push(e);
}
});
if(tmp.length>=1){
tmp.sort();
$.each(tmp[0].address_components,function(i,e){
if(e.types=='postal_code') console.log(e.short_name);
if(e.types[0]=='administrative_area_level_1') console.log(e.short_name);
if(e.types[0]=='locality') console.log(e.short_name);
});
}
});

hodl
- 1,420
- 12
- 21