【发布时间】:2020-02-18 10:55:18
【问题描述】:
我正在使用Distant Matrix API 来计算地点和建议之间的距离。我在索引刀片上使用了一个脚本,它提示'google is not defined'。
代码 sn-p:
function initialize() {
var input = document.getElementById('searchloc');
var options = {
types: ['geocode'], // this should work!
componentRestrictions: {country: "ae"}
};
var autocomplete = new google.maps.places.Autocomplete(input, options);
}
google.maps.event.addDomListener(window, 'load', initialize);
【问题讨论】:
标签: javascript google-maps laravel-5