|
@@ -1,5 +1,5 @@
|
|
|
import mitt from 'mitt'
|
|
|
-
|
|
|
+import libTransform from 'coordtransform';
|
|
|
import axios from 'axios' //{ axios } from '@/api'
|
|
|
|
|
|
|
|
@@ -25,6 +25,29 @@ let isValidPoint = (modelId)=>{//所存的modelId没被删或者它本身不在
|
|
|
}
|
|
|
|
|
|
|
|
|
+{
|
|
|
+ // 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 = {
|
|
|
+ aMapToWgs84, wgs84ToAMap
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
|
|
|
//江门本地版本
|
|
|
|
|
@@ -100,7 +123,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
let { THREE } = Potree.mergeEditStart(dom, mapDom)
|
|
|
let MergeEditor = viewer.modules.MergeEditor
|
|
|
Potree.settings.unableNavigate = true
|
|
|
-
|
|
|
+ Potree.setLonlat(lonlat[0], lonlat[1])
|
|
|
|
|
|
if(window.offline){//离线版 改目录
|
|
|
viewer.images360.tileDownloader.getTiles = function(d, sceneNum, useV4url, model){
|
|
@@ -113,6 +136,17 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /* Potree.loadControlPoint = async function(callback,sceneCode,onError,prefix){//点云绑定地图
|
|
|
+ let path = `/laser/jm/${sceneCode}/getDataSetAndControlPoint`
|
|
|
+ return Potree.loadFile(path, {
|
|
|
+ fetchMethod: 'post'
|
|
|
+ }, callback,onError)
|
|
|
+ } */
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//因为getPose里用的是target,俯视的yaw不准,所以限制一下不要完全俯视
|
|
|
viewer.mainViewport.view.maxPitch-=0.001
|
|
|
viewer.mainViewport.view.minPitch+=0.001
|
|
@@ -369,7 +403,8 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
}, //触发结束。退出测量模式,清除之前操作 */
|
|
|
destroy: () => {
|
|
|
viewer.dispatchEvent({ type: 'cancel_insertions', remove: true, measure })
|
|
|
- viewer.scene.removeMeasurement(measure)
|
|
|
+
|
|
|
+ viewer.scene.removeMeasurement(measure)
|
|
|
},
|
|
|
|
|
|
/* getPoints: () => {
|
|
@@ -697,7 +732,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
map.switchStyle(type )
|
|
|
}, */
|
|
|
switchMapType(type){//切换成江门的卫星或标准
|
|
|
-
|
|
|
+ return;
|
|
|
console.log('switchMapType',type)
|
|
|
let maximumLevel, url
|
|
|
if(type == 'satellite'){
|
|
@@ -1456,6 +1491,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
}else{
|
|
|
viewer.dispatchEvent({ type: 'cancel_insertions', dontRemove: true, measure:path })
|
|
|
}
|
|
|
+ console.log('changeCanEdit',state)
|
|
|
path.setAddOrRemPoint(state)
|
|
|
},
|
|
|
visibility(v){
|
|
@@ -1854,9 +1890,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
|
|
|
cesiumViewer.imageryLayers.removeAll();
|
|
|
cesiumViewer.imageryLayers.addImageryProvider(imageryProvider);
|
|
|
|
|
|
- //lonlat = [113.595236803415,22.3665168584444]//[113.600356,22.364093]
|
|
|
- Potree.setLonlat(lonlat[0], lonlat[1])
|
|
|
-
|
|
|
+
|
|
|
Potree.cesScreenshot = (w,h)=>{
|
|
|
console.log('cesScreenshot',w,h)
|
|
|
cesiumViewer.scene.canvas.style.width = w+'px'
|