我有一个简单的应用程序,客户可以将他们的服务位置作为URL发送,如下所示:
当技术人员预定访问时,他们只需点击链接,Google就会显示到该地址的地图。
我想要实现的下一件事是在地图上一起展示其中的几个(就像所有技术人员一整天的访问一样)。如何使用Google将这些地址URls作为标记放在地图上?
发布于 2022-11-13 03:25:03
我想你需要使用这个https://developers.google.com/maps/documentation/javascript/adding-a-google-map医生
这里为例
function initMap() {
// The location of Uluru
const uluru = { lat: -25.344, lng: 13.031 };
const other = { lat: -25.344, lng: 10.031 };
// The map, centered at Uluru
const map = new google.maps.Map(document.getElementById("map"), {
zoom: 4,
center: uluru,
});
// The marker, positioned at first point
const marker = new google.maps.Marker({
position: uluru,
map: map,
});
// The marker, positioned at second point
const marker2 = new google.maps.Marker({
position: other,
map: map,
});
}
window.initMap = initMap;https://stackoverflow.com/questions/74418186
复制相似问题