【发布时间】:2017-10-13 05:54:06
【问题描述】:
我正在使用谷歌自动定位 api,但它没有显示在页面上..你们能找出代码中的问题吗?
我的脚本是:
<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"/>
【问题讨论】:
-
你的意思是从
places库自动完成搜索位置? -
是的,我正在使用地点库
标签: php forms api google-api