标记便签移除距离控制,仅保留视野内判断
This commit is contained in:
@@ -313,12 +313,10 @@ export class CesiumGlobe {
|
|||||||
_updateMarkerLayer() {
|
_updateMarkerLayer() {
|
||||||
const scene = this.viewer.scene;
|
const scene = this.viewer.scene;
|
||||||
const camera = scene.camera;
|
const camera = scene.camera;
|
||||||
const outOfRange = camera.positionCartographic.height > 8e6; // 最远 8000 km 内显示
|
|
||||||
|
|
||||||
for (const m of this.markers) {
|
for (const m of this.markers) {
|
||||||
const el = m.el;
|
const el = m.el;
|
||||||
if (!el) continue;
|
if (!el) continue;
|
||||||
if (outOfRange) { el.style.display = 'none'; continue; }
|
|
||||||
|
|
||||||
const win = Cesium.SceneTransforms.worldToWindowCoordinates(scene, m.position);
|
const win = Cesium.SceneTransforms.worldToWindowCoordinates(scene, m.position);
|
||||||
if (!win) { el.style.display = 'none'; continue; }
|
if (!win) { el.style.display = 'none'; continue; }
|
||||||
|
|||||||
Reference in New Issue
Block a user