Open zcloudyun opened 9 months ago
// vue文件使用 onLoaded1() { this.viewer1 = this.$refs.viewer1.GetViewer(); const layers1 = this.viewer1.GetLayers(); layers1.forEach(lyr => Vue.set(lyr, 'isVisible', true)); this.layers1 = layers1; this.canvas1 = this.viewer1.GetCanvas(); this.scene1 = this.viewer1.GetScene(); this.camera1 = this.viewer1.GetCamera(); this.renderer1 = this.viewer1.GetRenderer(); this.$nextTick(() => { this.controls1 = this.viewer1.GetControls(); this.controls1.addEventListener('change', () => { this.camera.position.copy(this.camera1.position); this.camera.zoom = this.camera1.zoom; this.camera.updateProjectionMatrix(); this.viewer.Render(); }); }); },
//DxfViewer.js中添加 GetControls(){ return this.controls }
// vue文件使用 onLoaded1() { this.viewer1 = this.$refs.viewer1.GetViewer(); const layers1 = this.viewer1.GetLayers(); layers1.forEach(lyr => Vue.set(lyr, 'isVisible', true)); this.layers1 = layers1; this.canvas1 = this.viewer1.GetCanvas(); this.scene1 = this.viewer1.GetScene(); this.camera1 = this.viewer1.GetCamera(); this.renderer1 = this.viewer1.GetRenderer(); this.$nextTick(() => { this.controls1 = this.viewer1.GetControls(); this.controls1.addEventListener('change', () => { this.camera.position.copy(this.camera1.position); this.camera.zoom = this.camera1.zoom; this.camera.updateProjectionMatrix(); this.viewer.Render(); }); }); },
//DxfViewer.js中添加 GetControls(){ return this.controls }