Google Map API自动填充功能。没有下拉列表

时间:2017-01-07 11:06:48

标签: javascript api dropdown

前段时间,这停止了下拉列表的生成。我需要改变什么?还有其他东西被弃用了吗?

       <!DOCTYPE html>
       <html>
       <head>
       <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=[mykey]&sensor=false&amp;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> 

0 个答案:

没有答案