admin管理员组文章数量:1336563
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!
本文标签: javascriptGradient polyline in cesium jsStack Overflow
版权声明:本文标题:javascript - Gradient polyline in cesium. js - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742403816a2468411.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论