javascript - Gradient polyline in cesium. js - Stack Overflow

Is there any way to display gradient polyline in cesium.js? Color will matter from speed like on garmin

Is there any way to display gradient polyline in cesium.js? Color will matter from speed like on garmin or strava. First get the color for first point, count percents of speed beetwen min speed and max speed and set for the start color then set the right color between blue and red with yellow on the middle, then for the second point set as end color and then display gradient for that petacular segment interpolated from start and end color. Also with 3d tileset please:) .

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <script src=".122/Build/Cesium/Cesium.js"></script>
  <link href=".122/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
  <style>
    html, body, #cesiumContainer {
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 0;
      overflow: hidden;
    }
  </style>
</head>
<body>
  <div id="cesiumContainer"></div>
  <script>
    Cesium.Ion.defaultAccessToken = 'MY_CESIUM.ION_ACCESS_TOKEN';
    const viewer = new Cesium.Viewer("cesiumContainer", {
        requestRenderMode: true,
        maximumRenderTimeChange: Infinity
    });
    positions = {
    // lat, lon, speed(m/s)
        -75, 35,30
        -100,35,56
        -125, 35,76
        -150,35,75
    }
    viewer.entities.add{
        //The magic here
    }
  </script>
</body>
</html>

effect should look like this image from garmin

Thank you very much in advance!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742403816a4437440.html

相关推荐

  • javascript - Gradient polyline in cesium. js - Stack Overflow

    Is there any way to display gradient polyline in cesium.js? Color will matter from speed like on garmin

    8小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信