【发布时间】:2015-10-21 10:20:16
【问题描述】:
我想要经纬度坐标。而不是协调我得到这个
位置: 荷兰瓦尔勒 地址:荷兰瓦尔勒 纬度:未定义 经度:未定义
<script type="text/javascript">
google.maps.event.addDomListener(window, 'load', intilize);
function intilize() {
var autocomplete = new google.maps.places.Autocomplete(document.getElementById("txtautocomplete"));
google.maps.event.addListener(autocomplete, 'place_changed', function () {
var place = autocomplete.getPlace();
var location = "Address: " + place.formatted_address + "<br/>";
location += "Latitude: " + place.geometry.location.A + "<br/>";
location += "Longitude: " + place.geometry.location.F;
document.getElementById('lblresult').innerHTML = location
});
};
</script>
<span>location:</span><input type="text" id="txtautocomplete" style="width:200px" placeholder="enter the adress"/>
<label id="lblresult"></label>
</body>
【问题讨论】: