【发布时间】:2012-01-20 13:26:40
【问题描述】:
我目前正在使用 google maps api 对地图上的位置进行地理编码并返回街道地址。
我目前用以下代码返回地址:
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
帮助表示赞赏。
【问题讨论】:
标签: javascript google-maps geocoding