Автозагрузки Google не работает на моей php-странице

Я использую автоматическое местоположение api Google, но оно не отображается на странице. Можете ли вы выяснить, что случилось в коде.

Мой скрипт:

<script> function init() { var input = document.getElementById('locationTextField'); var input2 = document.getElementById('locationTextField2'); var autocomplete = new google.maps.places.Autocomplete(input); var autocomplete = new google.maps.places.Autocomplete(input2); } google.maps.event.addDomListener(window, 'load', init); </script> 

Мой html-код:

  <input type="text" id="locationTextField" placeholder="Source Location"/> <input type="text" id="locationTextField2" placeholder="Destination Location"/> 

Загрузите свой скрипт с действующим ключом api на своем сайте,

 <script src="https://maps.googleapis.com/maps/api/js?key=<YOUR_API_KEY>&v=3.exp&sensor=false&libraries=places"></script> 

Вот пример (без ключа api для демонстрации только):

 function initialize() { new google.maps.places.Autocomplete((document.getElementById('source')), { types: ['geocode'] }); new google.maps.places.Autocomplete((document.getElementById('dest')), { types: ['geocode'] }); } google.maps.event.addDomListener(window, 'load', initialize); 
 <script src="http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places&dummy=.js"></script> <input id="source" name="source" value="" type="text" size="50" placeholder="Source" /> <input id="dest" name="dest" value="" type="text" size="50" placeholder="Destincation" />