function initMap() {
// The location of Uluru
const uluru = { lat: -25.344, lng: 131.031 };
// The map, centered at Uluru
const map = new google.maps.Map(document.getElementById("map"), {
zoom: 4,
center: uluru,
});
// The marker, positioned at Uluru
const marker = new google.maps.Marker({
position: uluru,
map: map,
});
}
window.initMap = initMap;
这工作正常,而是找到并输入纬度和经度:
纬度:-25.344,经纬度:131.031
有没有办法在代码中制作一些东西,例如:
“新建你的城市......一些街道地址”,它会导航到它? 我知道你可以用一个按钮来找到位置但是如何在代码中做一些静态的东西你放一个字符串它会找到它?