From 6bd2f38ce87270d1d23bb741529c23542ae3a31b Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期二, 27 六月 2023 17:51:43 +0800 Subject: [PATCH] 1 --- ExportMap/UE.html | 64 ++++++++------------------------ 1 files changed, 16 insertions(+), 48 deletions(-) diff --git a/ExportMap/UE.html b/ExportMap/UE.html index b755618..0d26ffd 100644 --- a/ExportMap/UE.html +++ b/ExportMap/UE.html @@ -64,6 +64,7 @@ var coordinate = { x: 117.038112825, y: 39.382696649 } var Wgs84ToLocal = map.transformWGS84ToLocal(coordinate.x, coordinate.y) console.log('Wgs84ToLocal', Wgs84ToLocal) + var LocalToWGS84 = map.transformLocalToWGS84(Wgs84ToLocal.x, coordinate.y) console.log('LocalToWGS84', LocalToWGS84) } @@ -124,7 +125,6 @@ var lbl = map.createLabel(options); // lbl.show(true); // 鏄剧ず - } // POI鐐� @@ -159,7 +159,7 @@ // 3DPOI鐐� function create3DBillboard() { var testPoints = [{ "x": 10000, "y": 10000, "z": 4000 }]; - var points = [] + var points = []; testPoints.forEach(function (item) { points.push({ x: item.x, @@ -170,38 +170,20 @@ scale: 20, clickedScale: 1, flash: false, - canClick: true, - + canClick: true }); }); - poi = map.create3DBillboard(points) - poi.forEach(function (b) { - b.show(true) - }) - var enable = true; // 鏄�/鍚﹀紑鍚洖璋� - obj = obj.concat(poi); - // poi.show(false); // 闅愯棌 - // poi.removeFromMap(); // 绉婚櫎 + var pois = map.create3DBillboard(points); + pois.forEach(function (poi) { + poi.show(true); + // poi.show(false); // 闅愯棌 + // poi.removeFromMap(); // 绉婚櫎 + }); } - function creat() { - map.Enable3DBillboardCallBack(true, function (e) { - console.log(e, "11111111111") - }) - } + // 娣诲姞绾胯矾 function createPolyline() { - // var obj = map.createPolyline({ - // pathWidth: 1000, // 璺緞瀹藉害 - // pathColor: "#00FF00", // 璺緞棰滆壊 - // type: 1, // 绾胯矾绫诲瀷: 0楂樹寒 1涓夎 2绠ご - // data: [ // 璺緞鐐逛綅鏁扮粍锛寀e4鍧愭爣 - // new TUVector3(-129.99, -7.41, 0), - // new TUVector3(-131.00, -134.96, 0), - // new TUVector3(113.83, -128.26, 0), - // new TUVector3(123.84, -550.99, 0) - // ] - // }); var testPoints = [ new TUVector3(77053.6953125, 150984.859375, 0), new TUVector3(16167.91015625, 151470.453125, 0), @@ -212,20 +194,18 @@ new TUVector3(11550.640625, -13705.76953125, 0), new TUVector3(7773.74560546875, -103738.140625, 0), ]; - testPointArray = [] + //缁樺埗璺緞 - pathObj = map.createPolyline({ + var pathObj = map.createPolyline({ data: testPoints, pathWidth: 3000, type: 0,//0楂樹寒绾� 1涓夎 2绠ご pathColor: "cyan", }); - var roll = 0, pitch = -45, yaw = 0, distance = 1000; var callBack = function () { console.log("flyTo"); } var time = 3; // 3s - map.flyTo(116.51446997, 39.772785555, 1000, roll, pitch, yaw, distance, callBack, time); } @@ -241,6 +221,7 @@ new TUVector3(0, 10000, 0) ] }); + // obj.removeFromMap(); // 绉婚櫎 } // 鍏夊湀 @@ -301,28 +282,15 @@ // 鎷惧彇鍧愭爣 function pickPosition() { - // map.pickPosition(function (e) { - - // alert(JSON.stringify(e)); // e.objectName-鍐呴儴缂栧彿锛宔.location-鐐逛綅鐨剈e4鍧愭爣 - // map.endPick(); // 鍙栨秷鎷惧彇 - // }); - - var vla = map.transformLocalToWGS84(map.camera.location.x, map.camera.location.y); - alert(JSON.stringify(vla)) + var obj = map.transformLocalToWGS84(map.camera.location.x, map.camera.location.y); + alert(JSON.stringify(obj)); } // 鎷惧彇瀵硅薄 function pickObject() { map.pickPosition(function (e) { - if (e) { - alert(JSON.stringify(e)) - } + alert(JSON.stringify(e)) }); - - // map.execute("factory", "callEvent", { eventName: "ClickObjectCallBack", param: "1" }, function (e) { - // console.log(e); - // map.execute("factory", "callEvent", { eventName: "ClickObjectCallBack", param: "0" }, null); // 鍙栨秷鎷惧彇 - // }); } // 娓呴櫎 -- Gitblit v1.9.3