如何在像 Here 地图这样的 google 地图中创建线串?

How to create Line string in google Maps like Here Maps?

此代码用于在 Here Maps 中创建线串,我试图在 google 地图中找到相同的东西,但我找不到

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;
    }

控制台返回的stripe值如下

在 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);