|
@@ -629,7 +629,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
comeTo(o = {}) {
|
|
|
//console.log('comeTo',o.position, o.target)
|
|
|
//飞到某个点
|
|
|
-
|
|
|
+
|
|
|
let deferred = $.Deferred()
|
|
|
if(o.panoId != void 0){
|
|
|
let model = o.model.model
|
|
@@ -647,9 +647,9 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
}else{
|
|
|
console.warn('没有找到漫游点',o)
|
|
|
}
|
|
|
- }else if(requestInPano){
|
|
|
+ }/* else if(requestInPano){
|
|
|
requestInPano.result_.flyOutPano()
|
|
|
- }else{
|
|
|
+ } */else{
|
|
|
if (o.modelId != void 0) {
|
|
|
['position', 'target'].forEach(e => {
|
|
|
if (o[e]) {
|
|
@@ -660,9 +660,9 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (o.distance) {
|
|
|
+ if (o.distance || o.maxDis) {
|
|
|
let position = o.target || o.position
|
|
|
- return viewer.focusOnObject({ position }, 'tag', null, { distance: o.distance }).promise
|
|
|
+ return viewer.focusOnObject({ position }, 'tag', null, { distance: o.distance, maxDis : o.maxDis }).promise
|
|
|
}
|
|
|
|
|
|
|
|
@@ -921,6 +921,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
let msg = {}
|
|
|
if (!lastState.position || !model.position.equals(lastState.position)) {
|
|
|
lastState.position = msg.position = model.position.clone()
|
|
|
+ //console.log('change pos', model.position.toArray())
|
|
|
}
|
|
|
if (!lastState.rotation || !model.rotation.equals(lastState.rotation)) {
|
|
|
lastState.rotation = msg.rotation = model.rotation.clone()
|
|
@@ -1069,12 +1070,12 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
model.dispatchEvent('transformChanged') //改了position */
|
|
|
},
|
|
|
changePosition(pos) {//校准取消时执行
|
|
|
- //console.log('changePosition', pos.x, pos.y, pos.z)
|
|
|
+ console.log('changePosition', pos.x, pos.y, pos.z)
|
|
|
model && model.position.copy(pos)
|
|
|
model.dispatchEvent({ type: 'position_changed' })
|
|
|
},
|
|
|
changeRotation(rot) {//校准取消时执行
|
|
|
- //console.log('changeRotation', rot.x, rot.y, rot.z)
|
|
|
+ console.log('changeRotation', rot.x, rot.y, rot.z)
|
|
|
model && model.rotation.setFromVector3(rot)
|
|
|
model.dispatchEvent({ type: 'rotation_changed' })
|
|
|
},
|