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,{
|
const player = new acapi.DigitalTwinPlayer(process.env.VUE_APP_PALYER_URL,{
|
||||||
domId,
|
domId,
|
||||||
iid,
|
iid,
|
||||||
reset:true,
|
// reset:true,
|
||||||
apiOptions:{
|
apiOptions:{
|
||||||
onReady: this.onReady,
|
onReady: this.onReady,
|
||||||
onLog: this.onLog, //可选参数,日志输出回调函数
|
onLog: this.onLog, //可选参数,日志输出回调函数
|
||||||
|
@ -34,7 +34,7 @@ export default class PlayerUtils{
|
||||||
onKeyPress:this.onKeyPress,
|
onKeyPress:this.onKeyPress,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
keyEventTarget: 'video',
|
keyEventTarget: 'none',
|
||||||
})
|
})
|
||||||
this.api = player.getAPI();
|
this.api = player.getAPI();
|
||||||
return player
|
return player
|
||||||
|
|
|
@ -45,7 +45,6 @@ export default class BaseComponent extends Vue {
|
||||||
this.$message.error("视口未加载完成")
|
this.$message.error("视口未加载完成")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.player.api.settings.setInteractiveMode(0)
|
|
||||||
this.player.api.camera.lookAt(
|
this.player.api.camera.lookAt(
|
||||||
11660869.788125,
|
11660869.788125,
|
||||||
3692656.110371,
|
3692656.110371,
|
||||||
|
@ -115,14 +114,83 @@ export default class BaseComponent extends Vue {
|
||||||
}),(res)=>{
|
}),(res)=>{
|
||||||
console.log(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);
|
||||||
}
|
}
|
||||||
layer.ids = options.map(item=>item.id);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
if(layer.selected){
|
if(layer.selected){
|
||||||
this.player.api.marker.show(layer.ids)
|
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{
|
}else{
|
||||||
|
if(trackCustom){
|
||||||
|
clearInterval(this.timerList[layer.value]);
|
||||||
|
this.timerList[layer.value] = null;
|
||||||
|
}
|
||||||
this.player.api.marker.hide(layer.ids)
|
this.player.api.marker.hide(layer.ids)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,25 +133,24 @@ export default class OverViewComponent extends BaseComponent {
|
||||||
}
|
}
|
||||||
layer.selected = !layer.selected;
|
layer.selected = !layer.selected;
|
||||||
if(layer.type === "moveMarker"){
|
if(layer.type === "moveMarker"){
|
||||||
this.addMarker(layer,true)
|
this.addCustom(layer,true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//进入自由导览
|
//进入自由导览
|
||||||
async showView (){
|
showView(){
|
||||||
this.toggleAllPanel();
|
this.toggleAllPanel();
|
||||||
await this.player.api.camera.lookAt(
|
this.player.api.camera.lookAt(
|
||||||
11660670.518125,
|
11660667.474375,
|
||||||
3692632.854824,
|
3692632.815,
|
||||||
15.530475,
|
11.3054,
|
||||||
0,
|
0,
|
||||||
9.213877,
|
-0.822798,
|
||||||
85.199608,
|
88.42289,
|
||||||
2
|
2,
|
||||||
)
|
()=>{
|
||||||
setTimeout(()=>{
|
this.player.api.settings.setInteractiveMode(1);
|
||||||
this.player.api.settings.setInteractiveMode(1);
|
this.player.api.settings.setMainUIVisibility(false)
|
||||||
this.player.api.settings.setMainUIVisibility(false)
|
})
|
||||||
},2000)
|
|
||||||
|
|
||||||
//todo 进入自由导览
|
//todo 进入自由导览
|
||||||
}
|
}
|
||||||
|
@ -196,6 +195,7 @@ export default class OverViewComponent extends BaseComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
console.log(layers)
|
||||||
return layers
|
return layers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue