我目前使用谷歌地图API来在地图上的地理位置地址,并返回该街道的地址。如何从Google地图地理编码返回地址类型?
目前,我用下面的代码返回地址:
function codeLatLng(markerPos) {
geocoder.geocode({'latLng': markerPos}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (results[1]) {
//Set markerAddress variable
var markerAddress = results[0].formatted_address;
alert(markerAddress);
...
但如果我不想使用地址元件类型返回格式的地址,但更详细的版本,我怎么能返回某个地址值如:http://code.google.com/apis/maps/documentation/geocoding/#Types
帮助赞赏。
嗯......这提醒为“未定义”任何其他的想法 – hairynuggets