前段时间,这停止了下拉列表的生成。我需要改变什么?还有其他东西被弃用了吗?
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=[mykey]&sensor=false&libraries=places"></script>
<script type="text/javascript">
.
.
infowindow = new google.maps.InfoWindow();
geocoder = new google.maps.Geocoder();
input = document.getElementById('address');
var adOptions = {
types: ['geocode']
};
autocomplete = new google.maps.places.Autocomplete(input, adOptions);
google.maps.event.addListener(autocomplete, 'place_changed', function() {
infowindow.close();
var place = autocomplete.getPlace();
.
.
}
document.getElementById('address').focus();
.
</script>
</head>
<body>
<div><input id="address" type="text" value="" onfocus="this.value='Enter location'"></div>
<div id="map_canvas" style="width: 100%; height: 100%"></div>
</body>
</html>