【发布时间】:2021-12-08 01:52:48
【问题描述】:
这是我用来单站打开谷歌地图的方法:
$(document).on('click', 'button', function () {
const location = "Empire state building"
const location2 = "Washington square park"
var url = `https://www.google.com.sa/maps/search/${location}?hl=en`
window.open(url, '_blank');
});
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
</head>
<body>
<button>OPEN GOOGLE MAPS</button>
</body>
</html>
如何在 url 中包含 location2 以制作多站路线?
【问题讨论】:
标签: javascript html jquery google-maps google-maps-api-3