|
@@ -1,91 +1,26 @@
|
|
|
import mitt from 'mitt'
|
|
|
import libTransform from 'coordtransform';
|
|
|
-//import axios from 'axios' //{ axios } from '@/api'
|
|
|
-import axios from '@/api/instance' //带token
|
|
|
+ import axios from 'axios' //{ axios } from '@/api'
|
|
|
+//import axios from '@/api/instance' //带token
|
|
|
//实时加载路径的版本
|
|
|
|
|
|
-let requestLoadCount = 0
|
|
|
-let maxLoadingCount = 2; //正在加载模型的最大数目
|
|
|
-//0看看,1看见,2深时,3用户上传三维模型,4深时mesh,5深光点云,6深光mesh
|
|
|
-const ModelTypes = {
|
|
|
- 0 : {name:'看看(八目)', panos4dkk:true},
|
|
|
- 1 : {name:'看见(双目转台)', panos4dkk:true, rot90:true},
|
|
|
- 2 : {name:'深时', },
|
|
|
- 3 : {name:'用户上传三维模型'},
|
|
|
- 4 : {name:'深时mesh(激光转台)',panos4dkk:true, rot90:true},//3dtiles or obj
|
|
|
- 5 : {name:'深光点云' },
|
|
|
- 6 : {name:'深光mesh',panos4dkk:true, rot90:true},//3dtiles
|
|
|
- 7 : {name:'圆周率相机' },//圆周率相机场景
|
|
|
- 8 : {name:'动画模型'}
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
-let satellite = true
|
|
|
-let defaultMapProps = satellite ?
|
|
|
-[{url: `//wprd04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=6&x={x}&y={y}&z={z}&layer=6&token=YOUR_API_KEY`, //style=6是卫星,7是标准
|
|
|
- maximumLevel: 18 ,
|
|
|
- name:'高德baseLayer'
|
|
|
-},{
|
|
|
- url: `//wprd04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}&layer=6&token=YOUR_API_KEY`, //style=6是卫星,7是标准
|
|
|
- maximumLevel: 18,
|
|
|
- name:'高德textLayer'
|
|
|
-}] : [{url: `//wprd04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}&layer=6&token=YOUR_API_KEY`, //style=6是卫星,7是标准
|
|
|
- maximumLevel: 19,
|
|
|
- name:'高德baseLayer'
|
|
|
-}]
|
|
|
-
|
|
|
-
|
|
|
-let cesAspect , cesImageryProvider, mapProps = defaultMapProps
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-const Id_noIntersect = -100 //path绘制在地图上的点,modelId传这个值,勿更改
|
|
|
-let isValidPoint = (modelId)=>{//所存的modelId没被删或者它本身不在模型上
|
|
|
- return modelId == Id_noIntersect || viewer.objs.children.concat(viewer.scene.pointclouds).some(e=>e.dataset_id == modelId )
|
|
|
-}
|
|
|
-let curSelectPath
|
|
|
-
|
|
|
-{
|
|
|
- // 84坐标转高德 (国外地区用84,所以地理注册时填的是84,我这需要转成高德)
|
|
|
- const wgs84ToAMap = (pos ) => {
|
|
|
- const latlng = libTransform.wgs84togcj02(pos.x, pos.y)
|
|
|
- return {
|
|
|
- x: latlng[0],
|
|
|
- y: latlng[1]
|
|
|
- }
|
|
|
- }
|
|
|
- // 高德坐标转84
|
|
|
- const aMapToWgs84 = (pos ) => {
|
|
|
- const latlng = libTransform.gcj02towgs84(pos.x, pos.y)
|
|
|
- return {
|
|
|
- x: latlng[0],
|
|
|
- y: latlng[1]
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- window.AMapWith84__ = { //在Potree里setLonlat时不管转不转效果都一样 很奇怪,所以这里改名。只在ces
|
|
|
- aMapToWgs84, wgs84ToAMap
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
let aniPaths = [], pathDevices = [], pathHistorys = new Map
|
|
|
-let createAnimatePath = ()=>{//实时路径 保存:generateAniPathData
|
|
|
+let createAnimatePath = (token)=>{//实时路径 保存:generateAniPathData
|
|
|
let caseId = Potree.browser.urlHasValue('caseId',true)
|
|
|
let count = 0
|
|
|
|
|
|
- let addPath
|
|
|
+ let addPath
|
|
|
let interval = setInterval(async ()=>{
|
|
|
const list = await axios.get("/fusion/caseDevice/list", {
|
|
|
params: {
|
|
|
caseId
|
|
|
- }
|
|
|
+ },
|
|
|
+ headers: {
|
|
|
+ Token: `${token}`,
|
|
|
+ },
|
|
|
});
|
|
|
if(!list)return
|
|
|
try{
|
|
@@ -168,6 +103,89 @@ let createAnimatePath = ()=>{//实时路径 保存:generateAniPathData
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+let requestLoadCount = 0
|
|
|
+let maxLoadingCount = 2; //正在加载模型的最大数目
|
|
|
+//0看看,1看见,2深时,3用户上传三维模型,4深时mesh,5深光点云,6深光mesh
|
|
|
+const ModelTypes = {
|
|
|
+ 0 : {name:'看看(八目)', panos4dkk:true},
|
|
|
+ 1 : {name:'看见(双目转台)', panos4dkk:true, rot90:true},
|
|
|
+ 2 : {name:'深时', },
|
|
|
+ 3 : {name:'用户上传三维模型'},
|
|
|
+ 4 : {name:'深时mesh(激光转台)',panos4dkk:true, rot90:true},//3dtiles or obj
|
|
|
+ 5 : {name:'深光点云' },
|
|
|
+ 6 : {name:'深光mesh',panos4dkk:true, rot90:true},//3dtiles
|
|
|
+ 7 : {name:'圆周率相机' },//圆周率相机场景
|
|
|
+ 8 : {name:'动画模型'}
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+let satellite = true
|
|
|
+let defaultMapProps = satellite ?
|
|
|
+[{url: `//wprd04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=6&x={x}&y={y}&z={z}&layer=6&token=YOUR_API_KEY`, //style=6是卫星,7是标准
|
|
|
+ maximumLevel: 18 ,
|
|
|
+ name:'高德baseLayer'
|
|
|
+},{
|
|
|
+ url: `//wprd04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}&layer=6&token=YOUR_API_KEY`, //style=6是卫星,7是标准
|
|
|
+ maximumLevel: 18,
|
|
|
+ name:'高德textLayer'
|
|
|
+}] : [{url: `//wprd04.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}&layer=6&token=YOUR_API_KEY`, //style=6是卫星,7是标准
|
|
|
+ maximumLevel: 19,
|
|
|
+ name:'高德baseLayer'
|
|
|
+}]
|
|
|
+
|
|
|
+
|
|
|
+let cesAspect , cesImageryProvider, mapProps = defaultMapProps
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+const Id_noIntersect = -100 //path绘制在地图上的点,modelId传这个值,勿更改
|
|
|
+let isValidPoint = (modelId)=>{//所存的modelId没被删或者它本身不在模型上
|
|
|
+ return modelId == Id_noIntersect || viewer.objs.children.concat(viewer.scene.pointclouds).some(e=>e.dataset_id == modelId )
|
|
|
+}
|
|
|
+let curSelectPath
|
|
|
+
|
|
|
+{
|
|
|
+ // 84坐标转高德 (国外地区用84,所以地理注册时填的是84,我这需要转成高德)
|
|
|
+ const wgs84ToAMap = (pos ) => {
|
|
|
+ const latlng = libTransform.wgs84togcj02(pos.x, pos.y)
|
|
|
+ return {
|
|
|
+ x: latlng[0],
|
|
|
+ y: latlng[1]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 高德坐标转84
|
|
|
+ const aMapToWgs84 = (pos ) => {
|
|
|
+ const latlng = libTransform.gcj02towgs84(pos.x, pos.y)
|
|
|
+ return {
|
|
|
+ x: latlng[0],
|
|
|
+ y: latlng[1]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ window.AMapWith84__ = { //在Potree里setLonlat时不管转不转效果都一样 很奇怪,所以这里改名。只在ces
|
|
|
+ aMapToWgs84, wgs84ToAMap
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
let addedPath, floorCountEmited
|
|
|
let addPath = ()=>{//加个他们拍的路径
|
|
|
if(addedPath)return
|
|
@@ -261,9 +279,9 @@ let addPath = ()=>{//加个他们拍的路径
|
|
|
|
|
|
|
|
|
|
|
|
-export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOSSRoot, panoOSSRoot,ossRoot }) => {
|
|
|
+export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOSSRoot, panoOSSRoot,ossRoot }) => {
|
|
|
+ const token = Potree.browser.urlHasValue('token',true) || localStorage.getItem('token')
|
|
|
|
|
|
- console.warn('新的页面')
|
|
|
Potree.settings.isOfficial = true //标记为正式、非测试版本
|
|
|
//Potree.fileServer = axios
|
|
|
Potree.settings.libsUrl = './lib/'
|
|
@@ -370,7 +388,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
} */
|
|
|
|
|
|
|
|
|
- createAnimatePath()
|
|
|
+ createAnimatePath(token)
|
|
|
|
|
|
|
|
|
//因为getPose里用的是target,俯视的yaw不准,所以限制一下不要完全俯视
|