Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to realize two-dimensional and three-dimensional linkage in Cesium development

Shulou Source: shulou.com Published: 2022-06-01 03:41:55 09月29日 Update

This article mainly shows you "how to achieve two-dimensional linkage in Cesium development", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to achieve two-dimensional linkage in Cesium development" this article.

Feijinbala wants to make a linkage between cesium and two-dimensional map, first, according to the original idea, through the zoom range coordinates of two-dimensional map, calculate the viewing angle and viewing range of cesium, according to the coordinates of the central point of the two-dimensional map, set the camera coordinates of cesium, and then move the three-dimensional map when the two-dimensional map moves.

Later found that cesium's camera, setview function to support positioning to a range, set the range of a rectangle on the line, the zoom range of the two-dimensional map, given to the inside can be, two-dimensional map can now rotate horizontally, at the same time in cesium, can also be synchronous rotation, however, two-dimensional map control cesium, it is best to maintain vertical overlooking from top to bottom, so it is easier to calculate, synchronization effect is better.

When cesium controls 2D map synchronization, because in cesium, you can maintain a tilted angle of view, so the range in 2D map is not so accurate, especially when the tilt angle pitch is relatively small, then the viewing range is very large. Through the computeViewRectangle of camera in cesium, the viewing range is calculated and synchronized to the range of 2D map. When testing, in cesium, when it is very close to the map, keep the tilt angle pitch at about 10 degrees, the range of two-dimensional map synchronization is very large, coupled with the rotation in cesium, the two-dimensional map also has to rotate, so the range of synchronization error is larger. These are all the contents of the article "how to achieve two-dimensional and three-dimensional linkage in Cesium development". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Maps 2D range synchronization 3D time Development content coordinates articles large Tilt Angle Angle of View Learning help Control move simple accurate laborious Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Apple Redmi NVidia Shulou Information