我想获得街道地址,但什么也得不到。
提前致谢。
<script>
google.maps.event.addDomListener(window, 'load', function () {
var options = {
types: ['(address)'],
componentRestrictions: ['pk']
};
var input1 = document.getElementById('txtUserStartLocation');
var places = new google.maps.places.Autocomplete(input1, options);
var input2 = document.getElementById('txtUserDistination');
places = new google.maps.places.Autocomplete(input2, options)
});
</script>