Browse Source

3d地图 修改弹框

master
邓宏 2 years ago
parent
commit
c1a18e93a2
  1. 2
      src/view/park/Label.js
  2. 3
      src/view/park/center.vue

2
src/view/park/Label.js

@ -22,7 +22,6 @@ export default class Label extends THREE.Object3D{
this.#imgMesh=new THREE.Mesh(geometry,material) this.#imgMesh=new THREE.Mesh(geometry,material)
this.#imgMesh.renderOrder=6 this.#imgMesh.renderOrder=6
this.#imgMesh.position.set(115*this.#pos[0],this.#pos[1],115*(this.#pos[2] -0.01)) this.#imgMesh.position.set(115*this.#pos[0],this.#pos[1],115*(this.#pos[2] -0.01))
this.#imgMesh.rotation.x=-Math.PI/6
this.add(this.#imgMesh) this.add(this.#imgMesh)
var nameGeometry=new THREE.PlaneGeometry(this.#nameObj.box.width/16,this.#nameObj.box.height/16) var nameGeometry=new THREE.PlaneGeometry(this.#nameObj.box.width/16,this.#nameObj.box.height/16)
@ -35,7 +34,6 @@ export default class Label extends THREE.Object3D{
this.#nameMesh=new THREE.Mesh(nameGeometry, nameMaterial) this.#nameMesh=new THREE.Mesh(nameGeometry, nameMaterial)
this.#nameMesh.renderOrder=6 this.#nameMesh.renderOrder=6
this.#nameMesh.position.set(115*this.#pos[0],this.#pos[1]-0.5,115*(this.#pos[2] +0.01)) this.#nameMesh.position.set(115*this.#pos[0],this.#pos[1]-0.5,115*(this.#pos[2] +0.01))
this.#nameMesh.rotation.x=-Math.PI/8
this.add(this.#nameMesh) this.add(this.#nameMesh)
} }
refesh(){ refesh(){

3
src/view/park/center.vue

@ -321,8 +321,7 @@ import Label from './Label'
// //
popover = new CSS2DObject(model.value) popover = new CSS2DObject(model.value)
popover.position.set(-10,7,0) popover.position.set(-10,7,0)
popover.visible=false popover.element.style.opacity=0
console.log('---123-----',popover)
scene.add(popover) scene.add(popover)
var controls = new MapControls(camera, map.value) var controls = new MapControls(camera, map.value)

Loading…
Cancel
Save