In 2d map development, there is the Maxbounds or MaxExtent property, which limits the view of the map to a range of four to four coordinates. Compared with the two-dimensional map, the three-dimensional map has more parameters such as height, rotation and viewing Angle, so it can control more things than the two-dimensional map. Cesium has an API for setting the lowest and highest viewing heights, which can be controlled at the viewing heights.

Viewer. Scene. ScreenSpaceCameraController. MaximumZoomDistance = 100000; viewer.scene.screenSpaceCameraController.minimumZoomDistance = 10;

The API for the set four to range was not found and further development is required based on the existing API. The idea is to control the scope of browsing in the pre-set four to the range, real-time detection, beyond the range, let the lens back to the set range. The real-time monitoring function, using preRender, is executed very frequently: \

Viewer. Scene. PreRender. AddEventListener (function () {} / / function content);

The field of view of Cesium lens, at the beginning, computeViewRectangle was used to calculate the field of view of a viewing, and the result of calculation was west, East, North,south four range parameters;

let _viewRectangle = viewer.camera.computeViewRectangle();

Then compare the above 4 range parameters with the set 4-to-range. For the part beyond the range, use the set 4-to-range. Finally, force the viewing range of the camera to jump back to the viewing field to prevent it from going beyond the range. However, in such calculation, the scene has a certain jump and the effect is not ideal. Later, the set 4-to range is enlarged. Judge viewer. Camera. So although there is some error in the scope of viewing, but, the overall effect is better.