UNPKG

tedp

Version:

terra dp init

97 lines (78 loc) 2.35 kB
<!DOCTYPE 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; 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>span{ margin-left: 5px; } .input-text{ width:100px; height:25px; line-height:25px; vertical-align: middle; box-sizing: border-box; } .control-button{ height:25px; line-height:25px; cursor: pointer; padding: 2px 5px; box-sizing: border-box; margin-left:10px; } </style> </head> <body> <!--地图容器--> <div id="mapContainer"></div> <div class="control-box"> <span> 宽度:</span> <input class="input-text" type="text" id="widthInput" value="1920" /> <span> 高度:</span> <input class="input-text" id="heightInput" value="1080" /> <input class="control-button" type="button" value="设置" onclick="setRes()" > </div> <script type="text/javascript"> var map = TUMap.createMap({ //地图容器 id:"mapContainer", //UE4服务地址 必须设置 当前示例以地址栏地址 为服务地址 ,用户需要替换为自己的服务地址 url:window.parent.window.exampleServerUrl ,//"http://localhost:81/", }) ; //开始旋转 function setRes(){ //旋转时间 var width = parseInt(document.getElementById("widthInput").value); //角度 var height = parseInt(document.getElementById("heightInput").value); //巡航到某个位置 时长7秒 map.setResolution( width ,height ) ; } </script> </body> </html>