-1
我一直在尋找一段時間.... 我有一個Polyline
,路徑來自google.maps.geometry.encoding.decodePath
。獲取已解碼路徑谷歌地圖的中心
現在我想圍繞該路徑圍繞我的地圖,即使我不知道路徑的位置。
我該怎麼做?
我的代碼:
decodedPath = google.maps.geometry.encoding.decodePath(mapid);
var myLatlng = new google.maps.LatLng(0, 0);
let map = new google.maps.Map(document.getElementById(id), {
zoom: 1,
center: myLatlng,
mouseWheel:true
});
let poly = new google.maps.Polyline({
strokeColor: '#000',
strokeOpacity: 1.0,
strokeWeight: 3,
paths: decodedPath,
});
poly.setMap(map);
好,我知道了...... decodedpath [位置] .lat() – waah
你可以回答你自己的問題,並接受解決方案。 – bastelflp