Compare commits
No commits in common. "378de9418374ed046a1eb6aaed88efa1c2bce85b" and "b3d6a8aa29f6c78004b5137827b3511dd8f8941a" have entirely different histories.
378de94183
...
b3d6a8aa29
|
@ -9,7 +9,7 @@ export default class PlayerUtils{
|
|||
const player = new acapi.DigitalTwinPlayer(process.env.VUE_APP_PALYER_URL,{
|
||||
domId,
|
||||
iid,
|
||||
reset:true,
|
||||
// reset:true,
|
||||
apiOptions:{
|
||||
onReady: this.onReady,
|
||||
onLog: this.onLog, //可选参数,日志输出回调函数
|
||||
|
@ -34,7 +34,7 @@ export default class PlayerUtils{
|
|||
onKeyPress:this.onKeyPress,
|
||||
}
|
||||
},
|
||||
keyEventTarget: 'video',
|
||||
keyEventTarget: 'none',
|
||||
})
|
||||
this.api = player.getAPI();
|
||||
return player
|
||||
|
|
|
@ -45,7 +45,6 @@ export default class BaseComponent extends Vue {
|
|||
this.$message.error("视口未加载完成")
|
||||
return
|
||||
}
|
||||
this.player.api.settings.setInteractiveMode(0)
|
||||
this.player.api.camera.lookAt(
|
||||
11660869.788125,
|
||||
3692656.110371,
|
||||
|
@ -115,14 +114,83 @@ export default class BaseComponent extends Vue {
|
|||
}),(res)=>{
|
||||
console.log(res)
|
||||
});
|
||||
this.player.api.customObject.moveTo(layer.data.map(async(item)=>{
|
||||
const position = (await this.player.utils.getLonLat(item.position))[0]
|
||||
const newPosition = turf.destination(turf.point(position),layer.value==="car"?50:1,Math.random()*360,{units:"meters"}).geometry.coordinates
|
||||
const newLocation = (await this.player.utils.getPosition(newPosition))[0];
|
||||
if(!newLocation[2]){
|
||||
newLocation[2] = 0
|
||||
}
|
||||
return {
|
||||
id:item.id,
|
||||
location:newLocation,
|
||||
"smoothTime": 5
|
||||
}
|
||||
}),(data)=>{
|
||||
console.log(data)
|
||||
})
|
||||
|
||||
this.timerList[layer.value] = setInterval(()=>{
|
||||
this.player.api.customObject.moveTo(layer.data.map(async(item)=>{
|
||||
const position = (await this.player.utils.getLonLat(item.position))[0]
|
||||
const newPosition = turf.destination(turf.point(position),layer.value==="car"?50:1,Math.random()*360,{units:"meters"}).geometry.coordinates
|
||||
const newLocation = (await this.player.utils.getPosition(newPosition))[0];
|
||||
if(!newLocation[2]){
|
||||
newLocation[2] = 0
|
||||
}
|
||||
return {
|
||||
id:item.id,
|
||||
location:newLocation,
|
||||
"smoothTime": 5
|
||||
}
|
||||
}),(data)=>{
|
||||
console.log(data)
|
||||
})
|
||||
},5000)
|
||||
}else{
|
||||
layer.ids = options.map(item=>item.id);
|
||||
}
|
||||
}
|
||||
})
|
||||
}else{
|
||||
if(layer.selected){
|
||||
this.player.api.marker.show(layer.ids)
|
||||
if(trackCustom){
|
||||
this.player.api.customObject.moveTo(layer.data.map(async(item)=>{
|
||||
const position = (await this.player.utils.getLonLat(item.position))[0]
|
||||
const newPosition = turf.destination(turf.point(position),layer.value==="car"?50:1,Math.random()*360,{units:"meters"}).geometry.coordinates
|
||||
const newLocation = (await this.player.utils.getPosition(newPosition))[0];
|
||||
if(!newLocation[2]){
|
||||
newLocation[2] = 0
|
||||
}
|
||||
return {
|
||||
id:item.id,
|
||||
location:newLocation,
|
||||
"smoothTime": 5
|
||||
}
|
||||
}))
|
||||
|
||||
this.timerList[layer.value] = setInterval(()=>{
|
||||
this.player.api.customObject.moveTo(layer.data.map(async(item)=>{
|
||||
const position = (await this.player.utils.getLonLat(item.position))[0]
|
||||
const newPosition = turf.destination(turf.point(position),layer.value==="car"?50:1,Math.random()*360,{units:"meters"}).geometry.coordinates
|
||||
const newLocation = (await this.player.utils.getPosition(newPosition))[0];
|
||||
if(!newLocation[2]){
|
||||
newLocation[2] = 0
|
||||
}
|
||||
return {
|
||||
id:item.id,
|
||||
location:newLocation,
|
||||
"smoothTime": 5
|
||||
}
|
||||
}))
|
||||
},5000)
|
||||
}
|
||||
}else{
|
||||
if(trackCustom){
|
||||
clearInterval(this.timerList[layer.value]);
|
||||
this.timerList[layer.value] = null;
|
||||
}
|
||||
this.player.api.marker.hide(layer.ids)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,25 +133,24 @@ export default class OverViewComponent extends BaseComponent {
|
|||
}
|
||||
layer.selected = !layer.selected;
|
||||
if(layer.type === "moveMarker"){
|
||||
this.addMarker(layer,true)
|
||||
this.addCustom(layer,true)
|
||||
}
|
||||
}
|
||||
//进入自由导览
|
||||
async showView (){
|
||||
showView(){
|
||||
this.toggleAllPanel();
|
||||
await this.player.api.camera.lookAt(
|
||||
11660670.518125,
|
||||
3692632.854824,
|
||||
15.530475,
|
||||
this.player.api.camera.lookAt(
|
||||
11660667.474375,
|
||||
3692632.815,
|
||||
11.3054,
|
||||
0,
|
||||
9.213877,
|
||||
85.199608,
|
||||
2
|
||||
)
|
||||
setTimeout(()=>{
|
||||
-0.822798,
|
||||
88.42289,
|
||||
2,
|
||||
()=>{
|
||||
this.player.api.settings.setInteractiveMode(1);
|
||||
this.player.api.settings.setMainUIVisibility(false)
|
||||
},2000)
|
||||
})
|
||||
|
||||
//todo 进入自由导览
|
||||
}
|
||||
|
@ -196,6 +195,7 @@ export default class OverViewComponent extends BaseComponent {
|
|||
}
|
||||
}
|
||||
})
|
||||
console.log(layers)
|
||||
return layers
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue