(Nativescript+;谷歌地图SDK)多段线渐变颜色

(Nativescript+;谷歌地图SDK)多段线渐变颜色,nativescript,nativescript-vue,google-polyline,nativescript-google-maps-sdk,Nativescript,Nativescript Vue,Google Polyline,Nativescript Google Maps Sdk,我正在使用nativescript+vuejs开发一个应用程序。 该应用程序的主要功能包括在两个地理点之间绘制路线 我在想,我怎么能用渐变绘制多段线呢 重新衍生多段线的函数: async drawRoute(mapView, encodedPolylinePoints) { mapView.removeAllPolylines(); let routeCordinates = decodePolyline(encodedPolylinePoints); let poly

我正在使用nativescript+vuejs开发一个应用程序。 该应用程序的主要功能包括在两个地理点之间绘制路线

我在想,我怎么能用渐变绘制多段线呢

重新衍生多段线的函数:

async drawRoute(mapView, encodedPolylinePoints) {
    mapView.removeAllPolylines();

    let routeCordinates = decodePolyline(encodedPolylinePoints);
    let polyline = new Polyline();

    await Promise.all(routeCordinates.map(point =>
        polyline.addPoint(Position.positionFromLatLng(point.lat, point.lng))
    ));

    polyline.visible = true;
    polyline.geodesic = true;
    polyline.width = 20;
    // polyline.color = new Color('#f8006c'); <= the start gradient color
    polyline.color = new Color('#f8b244'); // <= the end gradient color

    mapView.addPolyline(polyline);
}
async drawRoute(mapView,encodedPolylinePoints){
removeAllPolylines();
设RouteCoordinates=解码多段线(编码多段线点);
设多段线=新多段线();
等待Promise.all(RouteCoordinates.map)(点=>
多段线.addPoint(位置.positionFromLatLng(point.lat,point.lng))
));
polyline.visible=true;
polyline.geodesic=真;
折线宽度=20;

//polyline.color=new color(“#f8006c”);谷歌地图尚不支持此特定功能。谷歌地图尚不支持此特定功能。