| | |
| | | viewer.on(that.DC.SceneEventType.CAMERA_CHANGED, (e) => { |
| | | //相机移动最后参数 |
| | | //控制高度 |
| | | if (that.dimension == "3D") { |
| | | console.log("3维不做高度限制"); |
| | | } |
| | | let isSet = that.dimension == "3D" ? false : true; |
| | | const height = Math.ceil(viewer.camera.positionCartographic.height); |
| | | let conBack = (height) => { |
| | | viewer.camera.setView({ |
| | |
| | | // if (height > 2000) { |
| | | // conBack(2000); |
| | | // } |
| | | if (height < 500) { |
| | | if (height < 500 && isSet) { |
| | | conBack(500); |
| | | } |
| | | if (height > 6000) { |
| | | if (height > 6000 && isSet) { |
| | | conBack(6000); |
| | | } |
| | | }); |
| | |
| | | }; |
| | | </script> |
| | | |
| | | <style lang='scss' scope> |
| | | <style lang="scss" scope> |
| | | #mobile-viewer-container { |
| | | width: 100%; |
| | | height: 100%; |