瀏覽代碼

加数据

DR/4DAGE 3 年之前
父節點
當前提交
edcb930ecc
共有 2 個文件被更改,包括 71 次插入15 次删除
  1. 59 12
      Map/data.js
  2. 12 3
      Map/map.js

+ 59 - 12
Map/data.js

@@ -140,6 +140,17 @@ var line=[
             waitTime:4,
             str:"为茶坑旧村历史地段的重要组成部分,有历史价值"
         },
+        {//忠玉梁公祠
+            name:"忠玉梁公祠",
+            alt: 28.274284297399483,
+            heading: 1.2287066157795232,
+            lat: 22.462739821900414,
+            lng: 113.0664213226606,
+            pitch: -0.7236309706591575,
+            roll: 0.002976371315909887,
+            waitTime:2,
+            str:""
+        },
         {  //茶坑旧乡府
             name:"茶坑旧乡府",
             alt: 31.063918900636192,
@@ -171,19 +182,41 @@ var line=[
             lng: 113.06678300569749,
             pitch: -0.1989809812357597,
             roll: 0.0024115893018885615,
-            waitTime:3,
+            waitTime:2,
             str:"设计草图完成后,由三江镇“泥水森”完成建造。1963年旧乡府改为学校,1977-1979年再次作为村委办公地"
         },
-        {  //茶坑旧乡府
+        {//茶坑旧乡府
             name:"茶坑旧乡府",
-            alt: 38.616472414120736,
-            heading: 1.798035637617863,
-            lat: 22.463297242465266,
-            lng: 113.06647920960381,
-            pitch: -0.46993093207755576,
-            roll: 0.002584840262850996,
+            alt: 27.48465683080448,
+            heading: 1.7928483842136211,
+            lat: 22.463068888647992,
+            lng: 113.06671277796342,
+            pitch: -0.37041981660592804,
+            roll: 0.0024754089088903086,
             waitTime:0,
-            str:"false"
+            str:""
+        },
+        // {  //茶坑旧乡府
+        //     name:"茶坑旧乡府",
+        //     alt: 38.616472414120736,
+        //     heading: 1.798035637617863,
+        //     lat: 22.463297242465266,
+        //     lng: 113.06647920960381,
+        //     pitch: -0.46993093207755576,
+        //     roll: 0.002584840262850996,
+        //     waitTime:0,
+        //     str:""
+        // },
+        {//石梁公祠
+            name:"石梁公祠",
+            alt: 38.36139358665662,
+            heading: 1.4533103000843965,
+            lat: 22.463086295845137,
+            lng: 113.06665922586362,
+            pitch: -0.544656098630222,
+            roll: 0.002747742998334246,
+            waitTime:2,
+            str:""
         },
         {  //远景
             alt: 32.011165994420104,
@@ -193,7 +226,7 @@ var line=[
             pitch: -0.164170332843125,
             roll: 0.002392292995022416,
             waitTime:0,
-            str:"false"
+            str:""
         },
         {  //远景
             alt: 39.13206138756523,
@@ -203,7 +236,7 @@ var line=[
             pitch: -0.2294494889919345,
             roll: 0.001543958614923291,
             waitTime:0,
-            str:"false"
+            str:""
         },
         { //回到起点
             alt: 20.090267875712017,
@@ -213,7 +246,7 @@ var line=[
             pitch: -0.17567078388335267,
             roll: 0.0007402932651014993,
             waitTime:0,
-            str:"false"
+            str:""
         },
 ];
 //景点位置
@@ -258,5 +291,19 @@ var ps=[{
     alt:20,
     minalt:15,
     name:"茶坑旧乡府"
+},
+{
+    lng:113.06664764076574,
+    lat:22.462775481061307,
+    alt:15,
+    minalt:5,
+    name:"忠玉梁公祠"
+},
+{
+    lng:113.06704873044083,
+    lat:22.463074350975013,
+    alt:20,
+    minalt:15,
+    name:"石梁公祠"
 }
 ];

+ 12 - 3
Map/map.js

@@ -152,7 +152,7 @@ function addStr(str){
     {
         txtdiv.removeChild(txtdiv.firstChild);
     }
-    if(str!="false"){
+    if(str!=""){
         setFont(str,txtdiv)
     }
    // setFontStyle()
@@ -235,12 +235,21 @@ function stop(){
 // var handler = new Global.ScreenSpaceEventHandler(map.viewer.scene.canvas);
 //     handler.setInputAction(function (event) {
 //         //1.椭球面坐标:获取当前点击视线与椭球面相交处的坐标,在加载地形的场景上获取的坐标有误差
-//         //var earthPosition = viewer.camera.pickEllipsoid(event.position,viewer.scene.globe.ellipsoid); 
+//       //  var earthPosition = map.viewer.camera.pickEllipsoid(event.position,map.viewer.scene.globe.ellipsoid); 
 
 //         //2.场景坐标:获取场景中任意点击处的对应的世界坐标,需要开启“地形深度检测”(在未开启“地形深度检测”的情况下只能在3DTile上准确获取空间坐标,开启“地形深度检测”后,viewer.scene.pickPosition 也能在非3DTile上准确获取坐标)
 //         map.viewer.scene.globe.depthTestAgainstTerrain = true;
- 
+//         var  position1 = map.viewer.scene.pickPosition(event.position);
 //         var ellipsoid = map.viewer.scene.globe.ellipsoid;
+//         var cartographic = ellipsoid.cartesianToCartographic(position1);
+//         var lat1 = Global.Math.toDegrees(cartographic.latitude);
+//         var lng1 = Global.Math.toDegrees(cartographic.longitude);
+//         var alt1 = cartographic.height;
+//         console.log({
+//             lat1:lat1,
+//             lng1:lng1,
+//             alt1:alt1
+//         })
 //         var cartographic = ellipsoid.cartesianToCartographic(map.viewer.camera.position);
 //         var lat = Global.Math.toDegrees(cartographic.latitude);
 //         var lng = Global.Math.toDegrees(cartographic.longitude);