From 3812765c14eb0b53baf0b91ad37f3f9bb7ab78a0 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期二, 27 六月 2023 09:25:45 +0800 Subject: [PATCH] 1 --- ExportMap/UE.html | 67 +++++++++++++++++---------------- 1 files changed, 35 insertions(+), 32 deletions(-) diff --git a/ExportMap/UE.html b/ExportMap/UE.html index 6827214..e869342 100644 --- a/ExportMap/UE.html +++ b/ExportMap/UE.html @@ -8,7 +8,6 @@ <meta http-equiv="Cache-control" content="no-cache" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <script src="js/jquery.1.12.4.js"></script> <script src="js/tumap.js"></script> <style> html, @@ -48,7 +47,7 @@ } </style> <script> - $(function () { + window.onload = function () { window.map = new TUMap({ id: 'map', // div鐨刬d url: 'http://192.168.20.39:91', // UE鏈嶅姟鍦板潃 @@ -57,18 +56,13 @@ console.log("鍒濆鍖栧畬鎴�"); } }) - }); + } - // 杞负WGS84鍧愭爣 - function toWGS84() { + // 鍧愭爣杞寲 + function transform() { var trans = new TUTransForm({ x: 117.038112825, y: 39.382696649 }); trans.transformWGS84ToLocal(); trans.transformLocalToWGS84(); - } - - // 杞负UE鍧愭爣 - function toUECoord() { - } // 鑾峰彇闀滃ご淇℃伅 @@ -81,39 +75,48 @@ // 椋炶 function flyTo() { + var x = 117.038112825, y = 39.382696649, z = 5000; + var roll = 0, pitch = 0, yaw = 0, distance = 1000; + var callBack = function () { console.log("flyTo"); } + var time = 3; // 3s + map.flyTo(x, y, z, roll, pitch, yaw, distance, callBack, time); } // 鍒囨崲闀滃ご function setView() { + var x = 117.038112825, y = 39.382696649, z = 5000; + var roll = 0, pitch = 0, yaw = 0, distance = 1000; + map.setView(x, y, z, roll, pitch, yaw, distance); } - // 澶╂皵鐗规晥锛歴un-鏅村ぉ ,rain-闆ㄥぉ,snow-闆ぉ + // 澶╂皵鐗规晥 function setWeather() { + // sun-鏅村ぉ ,rain-闆ㄥぉ,snow-闆ぉ map.setWeather("snow"); } - // 鏃堕棿鐗规晥锛歮orning-鏃╂櫒,noon-涓崍,evening-鍌嶆櫄,night-澶滄櫄,darkWorld-鏆楄壊鍦烘櫙 + // 鏃堕棿鐗规晥 function setTime() { + // morning-鏃╂櫒,noon-涓崍,evening-鍌嶆櫄,night-澶滄櫄,darkWorld-鏆楄壊鍦烘櫙 map.setTime("night"); } // 鏂囧瓧鏍囩 function createLabel() { var options = { - id: 1, //鍞竴鏍囪瘑锛屼笉鍙噸澶� 鍙笉濉� - x: 1000, //x杞磚e4鍧愭爣 - y: 1000, //y杞磚e4鍧愭爣 - z: 0,//z杞磚e4鍧愭爣 - vectorType: "WGS84",//鍧愭爣绫诲瀷 2.1.5鐗堟湰鍚庡彲璁剧疆 - size: { width: 480, height: 180 },//label鐨勫ぇ灏� - text: '娴嬭瘯鏂囧瓧',//鏄剧ず鐨勬枃瀛� - scale: 1,//缂╂斁 - type: 'Type1',//绫诲瀷 Default,Type1,Type2 - backgroundColor: "#ffffff",//鑳屾櫙鑹� 鏀寔rgba TUColor - fillColor: "#00ff00",//鏂囧瓧棰滆壊 - visibility: true//榛樿鏄惁鏄剧ず + id: 1, // 鍞竴鏍囪瘑锛屼笉鍙噸澶嶏紝鍙笉濉� + x: 1000, // x杞磚e4鍧愭爣 + y: 1000, // y杞磚e4鍧愭爣 + z: 0, // z杞磚e4鍧愭爣 + size: { width: 480, height: 180 }, // label鐨勫ぇ灏� + text: '娴嬭瘯鏂囧瓧', // 鏄剧ず鐨勬枃瀛� + scale: 1, // 缂╂斁 + type: 'Type1', // 绫诲瀷 Default,Type1,Type2 + backgroundColor: "#ffffff", // 鑳屾櫙鑹叉敮鎸乺gba + fillColor: "#00ff00", // 鏂囧瓧棰滆壊 + visibility: true // 榛樿鏄惁鏄剧ず }; var lbl = map.createLabel(options); @@ -131,8 +134,8 @@ y: 1000, // y杞磚e4鍧愭爣 z: 0, // z杞磚e4鍧愭爣 image: "http://www.terra-it.cn/images/tubiao/indexLogo.png", // 鍥剧墖鍦板潃 - scale: 0.5,//缂╂斁 - clickedScale: 0.7, + scale: 0.5, // 缂╂斁姣斾緥 + clickedScale: 0.7, // 鐐瑰嚮鍚庢瘮渚� visibility: true, // 榛樿鏄惁鏄剧ず alertWindow: { // 鍙�夛紝鐐瑰嚮寮圭獥 url: "http://localhost/testAlertWindow.html", // 寮圭獥鍦板潃 @@ -163,7 +166,7 @@ scale: 0.5,//缂╂斁 clickedScale: 0.7, visibility: true, // 榛樿鏄惁鏄剧ず - alertWindow: {//鍙�夛紝鐐瑰嚮寮圭獥 + alertWindow: { // 鍙�夛紝鐐瑰嚮寮圭獥 url: "http://localhost/testAlertWindow.html", // 寮圭獥鍦板潃 size: new Vector2(180, 90), // 寮圭獥澶у皬 offset: new Vector2(50, -100) // 寮圭獥浣嶇疆锛屽彸锛歺姝o紝涓嬶細y姝� @@ -215,10 +218,10 @@ var param = { location: new TUVector3(0, 0, 0), // 涓績鐐� radius: 15000, - type: 2, //0涓婃诞妯牸锛�1瀹炶壊锛�2绠ご锛�3涓夎 + type: 2, // 0涓婃诞妯牸锛�1瀹炶壊锛�2绠ご锛�3涓夎 color: "#ff0000", - height: 15000, //榛樿5000 - brightness: 10 //榛樿10 + height: 15000, // 榛樿5000 + brightness: 10 // 榛樿10 } var circle = map.createCircleArea(param); // circle.removeFromMap(); // 绉婚櫎 @@ -288,14 +291,14 @@ map.resetTime(); // 绉婚櫎鏃堕棿鐗规晥 map.clearAllCovering(); // 娓呴櫎鎵�鏈夎鐩栫墿 } + </script> </head> <body> <div id="map"></div> <div id="container"> - <button onclick="toWGS84();">杞负WGS84鍧愭爣</button> - <button onclick="toUECoord();">杞负UE鍧愭爣</button> + <button onclick="transform();">鍧愭爣杞崲</button> <button onclick="getCamera();">鑾峰彇闀滃ご淇℃伅</button> <button onclick="flyTo();">椋炶</button> <button onclick="setView();">鍒囨崲闀滃ご</button> -- Gitblit v1.9.3