這段代碼是在這里地圖中創建線串,我試圖在谷歌地圖中找到同樣的東西,但我找不到
this.GetCoordinates = function (polyPoints) {
var strips = new H.geo.LineString();
for (var i = 0; i < polyPoints.length; i ) {
strips.pushPoint(new H.geo.Point(polyPoints[i].lng, polyPoints[i].lat));
}
return strips;
}
控制臺中回傳的條帶值如下

uj5u.com熱心網友回復:
在 nodeJS 中:
const gpoly = require('google-polyline')
const decodedPath = gpoly.decode(encodedPath);
console.log(`decodedPath`,decodedPath); // array of [lat,lng]
在瀏覽器的 JS 中:
const decodedPath = google.maps.geometry.encoding.decodePath(encodedPath);
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/469165.html
標籤:javascript 谷歌地图 谷歌地图 api-3 这里地图
