一、等高线是矢量线。。
加载的时候
如果是提前生成的等高线。。。加载时跟一般的矢量线没区别
二、cesium自动生成等高线
https://blog.csdn.net/weixin_35878962/article/details/111966615
根据地形瓦片直接绘制高程、坡度及等高线
第一步,加载地形瓦片
加载地形瓦片图层无需多言,前面已经有过介绍:
viewer.terrainProvider = new Cesium.CesiumTerrainProvider({
url : 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles',
requestWaterMask : true,
requestVertexNormals : true
});
var Cesium = require('cesium/Cesium'); require('cesium/Widgets/widgets.css'); var viewer = new Cesium.Viewer('cesiumContainer', { terrainProvider: Cesium.createWorldTerrain({ requestVertexNormals: true //Needed to visualize slope }) }); var tileset = new Cesium.Cesium3DTileset({ url: "http://localhost:8080/src/data/cesium" }); viewer.scene.primitives.add(tileset); viewer.zoomTo(tileset); var contourColor = Cesium.Color.RED.clone(); var contourUniforms = {}; var globe = viewer.scene.globe; var material; material = Cesium.Material.fromType('ElevationContour'); contourUniforms = material.uniforms; contourUniforms.width = 2.0; contourUniforms.spacing = 5.0; contourUniforms.color = contourColor; globe.material = material;
https://groups.google.com/g/cesium-dev/c/s7QzaMGprbU/m/BgDw518BBwAJ?pli=1
Apply materials like contour or color ramp based on elevation to a gLTFmodel:https://community.cesium.com/t/apply-materials-like-contour-or-color-ramp-based-on-elevation-to-a-gltfmodel/10458
cesium-elevation-gradient:https://github.com/PropellerAero/cesium-elevation-gradient