In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how Cesium loads stereo lines in batches. I hope you will get something after reading this article. Let's discuss it together.
In the sample program of Cesium's official website, how to draw a line into a three-dimensional shape, the detailed address is: https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/index.html?src=Corridor.html&label=Geometries
In the sample program of Cesium's official website, how to load the data of geojson. The detailed address is: https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/index.html?src=GeoJSON%20and%20TopoJSON.html&label=DataSources.
So, how to bulk load the geojson data into a three-dimensional linear mode, the following is a detailed implementation code:
Load the geojson and wait synchronously.
Let promise = Cesium.GeoJsonDataSource.load ('data/guizhouroad1.geojson')
In the wait event, perform the conversion of the line to a solid column
Promise.then (function (dataSource) {
/ / entities loaded by geojson
Let entities = dataSource.entities.values
/ / convert solid columnar lines
Entity.polylineVolume = new Cesium.PolylineVolumeGraphics ({
/ / set the location
Positions: entity.polyline.positions
/ / calculate solid cylindrical coordinates
Shape: computeCircle (300.0)
/ / set color or map
Material: Cesium.Color.RED
});
/ / set the plane to be empty first
Entity.polyline = null
}
/ / add a data source and zoom over
Viewer.dataSources.add (dataSource)
Viewer.zoomTo (viewer.entities)
Console.log (idx)
) .otherwise (function (error) {
Window.alert (error)
});
/ / calculate the solid cylindrical function
Function computeCircle (radius) {
Var positions = []
For (var I = 0; I < 360; I + = 2) {
Var radians = Cesium.Math.toRadians (I)
Positions.push (new Cesium.Cartesian2 (radius * Math.cos (radians), radius * Math.sin (radians)
}
Return positions
}
After reading this article, I believe you have a certain understanding of "how to bulk load stereo lines in Cesium". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.