tedp
Version:
terra dp init
104 lines (88 loc) • 3.04 kB
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="./dist/tumap.js"></script>
<style>
* {
margin: 0;
padding: 0;
}
#mapContainer{
position:absolute;
width:100%;
height:100%;
}
.control-box{
position:absolute;
right:10px;
top:5px;
min-width: 100px;
min-height: 40px;
background:rgba(0,0,0,.5);
border:1px solid rgba(255,255,255,.8);
border-radius: 6px;
overflow: hidden;
color:#fff;
font-size:13px;
padding: 5px;
box-sizing: border-box;
}
.control-box>input{
height:25px;
line-height:25px;
cursor: pointer;
padding: 2px 5px;
box-sizing: border-box;
margin:0;
}
</style>
</head>
<body>
<!--地图容器-->
<div id="mapContainer"></div>
<div class="control-box">
<input type="button" value="开启对象获取" onclick="startPick()" >
<input type="button" value="结束对象获取" onclick="endPick()" >
<input class="control-button" type="button" value="创建光圈" onclick="create()" >
</div>
<script type="text/javascript">
var map = TUMap.createMap({
//地图容器
id:"mapContainer",
//UE4服务地址 必须设置 当前示例以地址栏地址 为服务地址 ,用户需要替换为自己的服务地址
url:window.parent.window.exampleServerUrl ,//"http://localhost:81/",
}) ;
//巡航过程中可以停止
function startPick() {
var aaa = null;
map.execute("factory","callEvent",{
eventName:"ClickObjectCallBack",
param:"1"
},function(e){
console.log(">>>>>>>>>获取对象回调>>>>>>>>>>>",e)
});
}
function endPick(){
map.execute("factory","callEvent",{
eventName:"ClickObjectCallBack",
param:"0"
},callBack=null)
}
//创建标签
function create(){
layerObject = map.createCircleArea({
location:new TUVector3(0, 0, 0),//中心点
radius:15000,
type: 2, //0上浮横格,1实色,2箭头,3三角
color:"#ff0000",
height:15000, //默认5000
brightness:10 //默认10
}) ;
//移动下位置
map.focusOn(new TUVector3(-265,269,376), new TURotator(0,-45,-45), 52450 );
}
</script>
</body>
</html>