|
@@ -128,13 +128,16 @@ export function start(dom, mapDom, number ){ //t-Zvd3w0m
|
|
|
|
|
|
var transformPointcloud = (pointcloud, dataset)=>{
|
|
var transformPointcloud = (pointcloud, dataset)=>{
|
|
var locationLonLat = dataset.location.slice(0,2)
|
|
var locationLonLat = dataset.location.slice(0,2)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //当只有一个dataset时,无论如何transform 点云和漫游点都能对应上。
|
|
|
|
|
|
- /* if(window.AMapWith84){//需要转换
|
|
|
|
- locationLonLat = AMapWith84.wgs84ToAMap({x:locationLonLat[0], y:locationLonLat[1]})
|
|
|
|
|
|
+ /* if(window.AMapWith84 && Potree.settings.mapCompany != 'google'){
|
|
|
|
+ locationLonLat = AMapWith84.wgs84ToAMap({x:locationLonLat[0], y:locationLonLat[1]})
|
|
|
|
+
|
|
locationLonLat = [locationLonLat.x,locationLonLat.y]
|
|
locationLonLat = [locationLonLat.x,locationLonLat.y]
|
|
} */
|
|
} */
|
|
-
|
|
|
|
- //当只有一个dataset时,无论如何transform 点云和漫游点都能对应上。
|
|
|
|
|
|
+
|
|
var location = viewer.transform.lonlatToLocal.forward(locationLonLat) //transform.inverse()
|
|
var location = viewer.transform.lonlatToLocal.forward(locationLonLat) //transform.inverse()
|
|
//初始化位置
|
|
//初始化位置
|
|
|
|
|
|
@@ -166,6 +169,12 @@ export function start(dom, mapDom, number ){ //t-Zvd3w0m
|
|
|
|
|
|
{//拿初始数据集作为基准。它的位置是000
|
|
{//拿初始数据集作为基准。它的位置是000
|
|
var locationLonLat = originDataset.location.slice(0,2)
|
|
var locationLonLat = originDataset.location.slice(0,2)
|
|
|
|
+
|
|
|
|
+ if(window.AMapWith84){//需要转换为高德的
|
|
|
|
+ locationLonLat = AMapWith84.wgs84ToAMap({x:locationLonLat[0], y:locationLonLat[1]})
|
|
|
|
+ locationLonLat = [locationLonLat.x,locationLonLat.y]
|
|
|
|
+ }
|
|
|
|
+
|
|
proj4.defs("LOCAL", "+proj=tmerc +ellps=WGS84 +lon_0=" + locationLonLat[0].toPrecision(15) + " +lat_0=" + locationLonLat[1].toPrecision(15)); //高德坐标系
|
|
proj4.defs("LOCAL", "+proj=tmerc +ellps=WGS84 +lon_0=" + locationLonLat[0].toPrecision(15) + " +lat_0=" + locationLonLat[1].toPrecision(15)); //高德坐标系
|
|
proj4.defs("LOCAL_MAP", "+proj=tmerc +ellps=WGS84 +lon_0=" + locationLonLat[0].toPrecision(15) + " +lat_0=" + locationLonLat[1].toPrecision(15));
|
|
proj4.defs("LOCAL_MAP", "+proj=tmerc +ellps=WGS84 +lon_0=" + locationLonLat[0].toPrecision(15) + " +lat_0=" + locationLonLat[1].toPrecision(15));
|
|
proj4.defs("WGS84", "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs");
|
|
proj4.defs("WGS84", "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs");
|