1202 lines
52 KiB
HTML
1202 lines
52 KiB
HTML
<!DOCTYPE html>
|
||
<html>
|
||
|
||
<head>
|
||
<title>众产地编器</title>
|
||
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0, shrink-to-fit=no">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
||
<link href="/jscss/style.css" rel="stylesheet" type="text/css" />
|
||
<link href="/zces108/widgets.css" rel="stylesheet" type="text/css" />
|
||
<style type="text/css">
|
||
#ceContainer {
|
||
position: absolute;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
}
|
||
|
||
.ceedit {
|
||
position: absolute;
|
||
top: 2em;
|
||
left: 0;
|
||
bottom: 2em;
|
||
background: #00000099;
|
||
border-radius: 0 1em 1em 0;
|
||
overflow: hidden;
|
||
transition: transform 0.8s;
|
||
}
|
||
|
||
.ceedit .savebtn {
|
||
position: absolute;
|
||
bottom: 0;
|
||
left: 0;
|
||
right: 0;
|
||
text-align: center;
|
||
background: #000000;
|
||
padding: 0.5em;
|
||
}
|
||
|
||
.ceedit.close {
|
||
transform: translateX(-100%);
|
||
}
|
||
|
||
.ceedit>div {
|
||
height: calc(100% - 1em);
|
||
overflow: auto;
|
||
margin: 0.5em;
|
||
}
|
||
|
||
.ceedit .title {
|
||
background: linear-gradient(90deg, black, transparent);
|
||
color: #ffffff;
|
||
padding: 0.5em;
|
||
font-size: 1.1em;
|
||
border-radius: 0.3em;
|
||
font-weight: bold;
|
||
min-width: 25em;
|
||
}
|
||
|
||
.ceedit .title .right {
|
||
float: right;
|
||
}
|
||
|
||
.ceedit .content {
|
||
color: #ffffff;
|
||
padding: 0.5em;
|
||
}
|
||
|
||
.ceedit .content .lab {
|
||
min-width: 5em;
|
||
text-align: right;
|
||
padding-top: 0.5em;
|
||
}
|
||
|
||
.cemsg {
|
||
position: absolute;
|
||
left: 0;
|
||
top: 2em;
|
||
overflow: overlay;
|
||
background: #00000099;
|
||
color: #ffffff;
|
||
border-radius: 0 0.5em 0.5em 0;
|
||
transition: transform 0.8s;
|
||
}
|
||
|
||
.cemsg.close {
|
||
transform: translateX(-100%);
|
||
}
|
||
|
||
.glbaddmsg {
|
||
bottom: 1em;
|
||
}
|
||
.billaddmsg {
|
||
bottom: 1em;
|
||
}
|
||
|
||
|
||
.ceeditpanel {
|
||
position: absolute;
|
||
right: 0.2em;
|
||
bottom: 0.2em;
|
||
display: none;
|
||
}
|
||
|
||
.ceeditpanel>div {
|
||
display: flex;
|
||
gap: 0.2em;
|
||
text-align: center;
|
||
}
|
||
|
||
.ceeditpanel>div>div {
|
||
padding: 0.2em 0.6em;
|
||
border-radius: 0.2em;
|
||
background: #e9e9e9;
|
||
border: 1px solid #000000;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.ceeditpanel>div>div>span {
|
||
display: block;
|
||
font-size: 0.7em;
|
||
}
|
||
|
||
.ceeditpanel>div>div.select {
|
||
background: #035681;
|
||
color: #ffffff;
|
||
border: 1px solid #008de9;
|
||
}
|
||
|
||
.cecontrolpanel {
|
||
position: absolute;
|
||
right: 0;
|
||
top: 0;
|
||
background: #ffffff66;
|
||
border-radius: 0 0 0 0.5em;
|
||
padding: 0.2em;
|
||
}
|
||
|
||
.cecontrolpanel .tip {
|
||
color: #000000;
|
||
}
|
||
|
||
.cecontrolhelp {
|
||
position: absolute;
|
||
right: 1em;
|
||
top: 3em;
|
||
display: none;
|
||
}
|
||
|
||
.cecontrolhelp>div {
|
||
background: #ffffff66;
|
||
border-radius: 0.5em;
|
||
padding: 1em;
|
||
}
|
||
|
||
.billmodels,
|
||
.glbmodels {
|
||
width: 20em;
|
||
padding: 1em;
|
||
}
|
||
|
||
.billmodels>div,
|
||
.glbmodels>div {
|
||
padding: 0.5em;
|
||
}
|
||
|
||
.billmodels img,
|
||
.glbmodels img {
|
||
width: 8em;
|
||
border: 1px solid #ffffff;
|
||
border-radius: 3px;
|
||
position: absolute;
|
||
right: 1em;
|
||
}
|
||
|
||
.billmodels .name,
|
||
.glbmodels .name {
|
||
margin-left:1.2em;
|
||
font-size: 0.9em;
|
||
color: #ffffff;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.billmodels .name:hover,
|
||
.glbmodels .name:hover {
|
||
color: #a0d2f3;
|
||
}
|
||
|
||
.billmodels .billpath,
|
||
.glbmodels .glbpath {
|
||
color: #ffd900;
|
||
}
|
||
|
||
|
||
|
||
.billmodels .title,
|
||
.glbmodels .title {
|
||
font-weight: bold;
|
||
background: #000000;
|
||
}
|
||
|
||
.enty.active .name {
|
||
color: aqua;
|
||
}
|
||
|
||
.ceedit_ts {
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
cursor: pointer;
|
||
}
|
||
</style>
|
||
|
||
</head>
|
||
|
||
<body style="background:#eeeeee;">
|
||
<div id="ceContainer"></div>
|
||
<div class="cecontrolpanel">
|
||
<div class="flex">
|
||
<div class="tip flex1"></div>
|
||
<div class="btn xs def" onclick="event.stopPropagation();ce.control_fly_open(false)">飞行</div>
|
||
<div class="btn xs def" onclick="event.stopPropagation();ce.control_fly_open(true)">步行</div>
|
||
<div class="btn xs def" onclick="event.stopPropagation();$5('.cecontrolhelp').toggle('', 0.2)">帮助</div>
|
||
</div>
|
||
</div>
|
||
<div class="cecontrolhelp" onclick="event.stopPropagation();$5(this).hide('', 0.2);">
|
||
<div>
|
||
<img src="/zces108/keyhelp.png" />
|
||
</div>
|
||
</div>
|
||
<div class="ceeditpanel">
|
||
<div>
|
||
<div class="op1" onclick="event.stopPropagation();ce.edit_setrightact(1)">移动<span>M</span></div>
|
||
<div class="op2" onclick="event.stopPropagation();ce.edit_setrightact(2)">高度<span style="font-size: 2em;height: 0.47em;overflow: hidden;">’</span></div>
|
||
<div class="op3" onclick="event.stopPropagation();ce.edit_setrightact(3)">缩放<span>●</span></div>
|
||
<div class="op4" onclick="event.stopPropagation();ce.edit_setrightact(4)">旋转<span>/</span></div>
|
||
<div class="op5" onclick="event.stopPropagation();ce.edit_setrightact(5)">Y轴<span>Y</span></div>
|
||
<div class="op6" onclick="event.stopPropagation();ce.edit_setrightact(6)">Z轴<span>Z</span></div>
|
||
<div onclick="event.stopPropagation();ce.edit_modelreset()">重置<span>Ctrl+Z</span></div>
|
||
<div onclick="event.stopPropagation();ce.edit_off()">关闭<span>ESC</span></div>
|
||
</div>
|
||
</div>
|
||
<div class="ceedit_ts" onclick="event.stopPropagation();$5(this).next().toggleClass('close');">📦</div>
|
||
<div class="ceedit" onclick="event.stopPropagation();">
|
||
<div>
|
||
<form>
|
||
<div class="title"><span onclick="$5(this).parent().next().toggle('slide', 0.2)">实景航拍图层</span>
|
||
<div class="right">
|
||
<a class="btn xs" onclick="tile_showadd()">添加</a>
|
||
</div>
|
||
</div>
|
||
<div class="content tiles">
|
||
</div>
|
||
<div class="title"><span onclick="$5(this).parent().next().toggle('slide', 0.2)">人工建模图层</span>
|
||
<div class="right">
|
||
<a class="btn xs" onclick="glb_showadd()">添加</a>
|
||
</div>
|
||
</div>
|
||
<div class="content glbs">
|
||
</div>
|
||
<div class="title"><span onclick="$5(this).parent().next().toggle('slide', 0.2)">指示牌图层</span>
|
||
<div class="right">
|
||
<a class="btn xs" onclick="bill_showadd()">添加</a>
|
||
</div>
|
||
</div>
|
||
<div class="content bills">
|
||
</div>
|
||
<div class="title"><span onclick="$5(this).parent().next().toggle('slide', 0.2)">飞行点</span>
|
||
<div class="right">
|
||
<a class="btn xs" onclick="fly_add()">添加本视角</a>
|
||
</div>
|
||
</div>
|
||
<div class="content flys">
|
||
</div>
|
||
<div class="title"><span onclick="$5(this).parent().next().toggle('slide', 0.2)">世界地图</span></div>
|
||
<div class="content char5">
|
||
<div class="ciy-form">
|
||
<label class="lang"><a href="https://cesium.com/platform/cesium-ion/" target="_blank" style="color:#80caff;">icn</a>授权</label>
|
||
<div>
|
||
<input type="text" name="ion" style="width:100%;" title="在cesium中注册后,添加对应token" />
|
||
</div>
|
||
</div>
|
||
<div class="ciy-form">
|
||
<label class="lang">地图样式</label>
|
||
<div>
|
||
<ciy-select com="wmts_style"></ciy-select>
|
||
</div>
|
||
</div>
|
||
<div class="ciy-form">
|
||
<label class="lang">地图服务商</label>
|
||
<div>
|
||
<ciy-select com="wmts_source"></ciy-select>
|
||
</div>
|
||
</div>
|
||
<div class="ciy-form wtms_ext wtms_2" style="display:none;">
|
||
<label class="lang">纯色地图</label>
|
||
<div>
|
||
底图颜色 <input type="text" name="map_color" style="width:6em;" title="输入#颜色号" />
|
||
</div>
|
||
</div>
|
||
<div class="ciy-form wtms_ext wtms_3" style="display:none;">
|
||
<label class="lang">天地图<a href="https://www.tianditu.gov.cn/" target="_blank" style="color:#80caff;">Token</a></label>
|
||
<div>
|
||
<input type="text" name="tdt_wmts_token" style="width:100%;" title="注册天地图后,输入其token" />
|
||
</div>
|
||
</div>
|
||
<div class="ciy-form">
|
||
<label class="lang">ion地形</label>
|
||
<div>
|
||
编号 <input type="text" name="ion_terrain" style="width:4em;" title="在cesium中注册后,添加合适的地形资源后,填写对应编号" />
|
||
</div>
|
||
</div>
|
||
<div class="ciy-form">
|
||
<label class="lang">自建影像</label>
|
||
<div>
|
||
<input type="text" name="my_wmts" style="width:100%;" title="输入影像网络地址" />
|
||
</div>
|
||
</div>
|
||
<div class="ciy-form">
|
||
<label class="lang">自建地形</label>
|
||
<div>
|
||
<input type="text" name="my_terrain" style="width:100%;" title="输入地形网络地址" />
|
||
</div>
|
||
</div>
|
||
<div class="ciy-form top">
|
||
<label class="lang">平面图</label>
|
||
<div>
|
||
<div class="py1">
|
||
<input type="text" name="my_singleimg_url" style="width:100%;" title="输入图片的网络地址,不输入为边框。可先通过边框判断位置,再参照边框绘制平面图" />
|
||
</div>
|
||
<div class="py1">
|
||
对角坐标
|
||
<a class="btn xs" name="my_singleimg_p1" onclick="getmaploc(this, 'data')">坐标点1</a>
|
||
<a class="btn xs" name="my_singleimg_p2" onclick="getmaploc(this, 'data')">坐标点2</a>
|
||
<a style="text-decoration: underline;font-size:0.8em;" onclick="flysingleimg()">飞到</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="title"><span onclick="$5(this).parent().next().toggle('slide', 0.2)">地图设置</span></div>
|
||
<div class="content char5">
|
||
<div class="ciy-form">
|
||
<label class="lang">操作模式</label>
|
||
<div>
|
||
<ciy-radio com="setop" />
|
||
</div>
|
||
</div>
|
||
<div class="ciy-form top">
|
||
<label class="lang">初始视角</label>
|
||
<div>
|
||
<div class="py1">
|
||
<ciy-radio com="setin" />
|
||
</div>
|
||
<div class="py1">
|
||
准备 <input type="text" name="flytime_load" style="width:3em;" title="飞入前预留加载时间" /> 秒
|
||
飞入 <input type="text" name="flytime_fly" style="width:3em;" title="飞入动画时间" /> 秒
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="ciy-form">
|
||
<label class="lang">光照时间</label>
|
||
<div class="flex">
|
||
<div>
|
||
<input type="text" name="sunhourmin" style="width:4em;text-align: center;" />
|
||
</div>
|
||
<div class="px3">
|
||
光照动画
|
||
</div>
|
||
<div>
|
||
<ciy-switch com="timeline" y="开启" n="关闭" />
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="ciy-form">
|
||
<label class="lang">阴影模式</label>
|
||
<div>
|
||
<ciy-radio com="sunshadow" />
|
||
</div>
|
||
</div>
|
||
<div class="ciy-form top">
|
||
<label class="lang">边界遮罩</label>
|
||
<div>
|
||
<div class="py1">
|
||
<input type="text" name="maskrange" style="width:100%;" title="lat,lng;...封闭围栏内显示,围栏外用颜色覆盖" />
|
||
</div>
|
||
<div class="py1">
|
||
<a class="btn xs" onclick="getmaploc(this,'maskrange');">拾取坐标</a>
|
||
颜色 <input type="text" name="maskcolor" style="width:5em;" title="十六进制颜色值,如#000000" />
|
||
透明度 <input type="text" name="maskopacity" style="width:3em;" title="1不透明,0全透明" />
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div style="height:4em;"></div>
|
||
<div class="savebtn">
|
||
<a class="btn lg" onclick="event.stopPropagation();saveset(this)">保存</a>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
|
||
<form>
|
||
<div class="cemsg tileaddmsg close" onclick="event.stopPropagation();">
|
||
<div class="ciy-rclose abs r0 t0" onclick="tile_close()"></div>
|
||
<div class="px4 py4 char4">
|
||
<div class="ciy-form">
|
||
<label>名称</label>
|
||
<div><input type="text" name="name" style="width:100%;" /></div>
|
||
</div>
|
||
<div class="ciy-form">
|
||
<label>本地资源</label>
|
||
<div><input type="text" name="localurl" style="width:100%;" /></div>
|
||
</div>
|
||
<div class="ciy-form add">
|
||
<label>远程资源</label>
|
||
<div><input type="text" name="url" style="width:100%;" /></div>
|
||
</div>
|
||
<div class="ciy-form">
|
||
<label>高程</label>
|
||
<div>
|
||
<input type="text" name="height" style="width:6em;" />米
|
||
</div>
|
||
</div>
|
||
<div class="ciy-form">
|
||
<div class="txt-right">
|
||
<a class="btn" onclick="tile_add()">添加</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
<form>
|
||
<div class="cemsg tileeditmsg close" onclick="event.stopPropagation();">
|
||
<div class="ciy-rclose abs r0 t0" onclick="tile_close()"></div>
|
||
<div class="px4 py4 char2">
|
||
<div class="ciy-form">
|
||
<label>名称</label>
|
||
<div><input type="text" name="name" style="width:100%;" /></div>
|
||
</div>
|
||
<div class="ciy-form">
|
||
<label>高程</label>
|
||
<div>
|
||
<input type="text" name="height" style="width:6em;" />米
|
||
<a class="btn xs" onclick="tile_setheight()">设置高度</a><br />
|
||
<a class="btn xs noload" onclick="tile_numheight(-10)" ondblclick="event.stopPropagation();return false;">-10</a>
|
||
<a class="btn xs noload" onclick="tile_numheight(-1)" ondblclick="event.stopPropagation();return false;">-1</a>
|
||
<a class="btn xs noload" onclick="tile_numheight(-0.1)" ondblclick="event.stopPropagation();return false;">-0.1</a>
|
||
<a class="btn xs noload" onclick="tile_numheight(0.1)" ondblclick="event.stopPropagation();return false;">+0.1</a>
|
||
<a class="btn xs noload" onclick="tile_numheight(1)" ondblclick="event.stopPropagation();return false;">+1</a>
|
||
<a class="btn xs noload" onclick="tile_numheight(10)" ondblclick="event.stopPropagation();return false;">+10</a>
|
||
</div>
|
||
</div>
|
||
<div class="ciy-form">
|
||
<div class="txt-right">
|
||
<a class="btn" onclick="tile_edit()">修改</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
<form>
|
||
<div class="cemsg glbaddmsg close" onclick="event.stopPropagation();">
|
||
<div class="ciy-rclose abs r0 t0" onclick="entity_close('.glbaddmsg')"></div>
|
||
<div>
|
||
<ul class="glbmodels"></ul>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
<form>
|
||
<div class="cemsg billaddmsg close" onclick="event.stopPropagation();">
|
||
<div class="ciy-rclose abs r0 t0" onclick="entity_close('.billaddmsg')"></div>
|
||
<div>
|
||
<div style="padding:1em;margin-bottom: -2em;">
|
||
<div class="ciy-form">
|
||
<label style="min-width:5em;">朝向</label>
|
||
<div><ciy-radio com="type" /></div>
|
||
</div>
|
||
</div>
|
||
<div class="billmodels"></div>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
<div id="alert_bind" style="display:none;">
|
||
<div class="char4 row">
|
||
<div class="ciy-form col-24 col-sm-24">
|
||
<label>绑定</label>
|
||
<div>
|
||
<ciy-select com="bind"></ciy-select>
|
||
</div>
|
||
</div>
|
||
<div class="ciy-form col-24 col-sm-24">
|
||
<label>名称</label>
|
||
<div>
|
||
<input type="text" name="name" style="width:100%;" />
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<script type="text/javascript" src="/jscss/ciy.js"></script>
|
||
<script type="text/javascript" src="/jscss/ciycmp.js"></script>
|
||
<script type="text/javascript" src="/zces108/Cesium.js"></script>
|
||
<script type="text/javascript" src="/zces108/ciyearth.min.js"></script>
|
||
<script type="text/javascript" src="/zces108/map.min.js"></script>
|
||
<script type="text/javascript" src="../common.js"></script>
|
||
<script>
|
||
'use strict';
|
||
var Glob = {};
|
||
var ce = new ciyearth();
|
||
Glob.dom_controltip = $5('.cecontrolpanel .tip');
|
||
|
||
function bill_showadd() {
|
||
var msgdom = $5('.billaddmsg');
|
||
msgdom.removeClass('close');
|
||
ciycmp({ dom: $5('[com=type]', msgdom), value: 'plane', range: [{ id: 'plane', name: '墙面' }, { id: 'billboard', name: '永正面' }] });
|
||
$5('.ceedit').addClass('close');
|
||
if (!Glob.billmodels) {
|
||
ciyfn.callfunc('getbillpath', {}, function (json) {
|
||
var trees = ciyfn.arr_treemap(json.list, 0);
|
||
Glob.billmodels = {list:[]};
|
||
var html = '';
|
||
html += fillchild(trees, 0);
|
||
function fillchild(sub, deep) {
|
||
if (!sub)
|
||
return '';
|
||
var cldhtml = '';
|
||
for (var m in sub) {
|
||
if (sub[m].child) {
|
||
var htmlchild = fillchild(sub[m].child, deep + 1);
|
||
if (htmlchild == '')
|
||
continue;
|
||
cldhtml += '<li><a class="billpath" onclick="bill_loadpath(this, ' + sub[m].id + ')">' + ciyfn.lang(sub[m].name) + '</a>';
|
||
if (sub[m].child) {
|
||
cldhtml += '<ul style="margin-left: '+(deep+1)+'em;">';
|
||
cldhtml += htmlchild;
|
||
cldhtml += '</ul><div class="billmodel_' + sub[m].id + '"></div>';
|
||
}
|
||
cldhtml += '</li>';
|
||
} else {
|
||
cldhtml += '<li><a class="billpath" onclick="bill_loadpath(this, ' + sub[m].id + ')">' + ciyfn.lang(sub[m].name) + '</a><div class="billmodel_' + sub[m].id + '"></div></li>';
|
||
}
|
||
}
|
||
return cldhtml;
|
||
}
|
||
$5('.billmodels').html(html);
|
||
});
|
||
}
|
||
}
|
||
function bill_loadpath(dom, pathid) {
|
||
if(dom.load)
|
||
return;
|
||
if (ciyfn.throttle(dom)) return;
|
||
ciyfn.callfunc('getbills', {cpath:pathid}, function (json) {
|
||
dom.load = true;
|
||
Glob.billmodels = ciyfn.objdeepmerge(Glob.billmodels, json);
|
||
console.log(Glob);
|
||
var html = '';
|
||
for (var i in json.list) {
|
||
var dat = json.list[i];
|
||
html += '<div onclick="bill_add(' + dat.id + ')" class="name" onmouseenter="bill_showimg(this, \'' + ciyfn.file_stor(dat.url) + '\')" onmouseleave="bill_hideimg(this)">' + dat.name + '<img style="display:none;" /></div>';
|
||
}
|
||
$5('.billmodel_' + pathid).html(html);
|
||
});
|
||
}
|
||
function bill_showimg(dom, url) {
|
||
var imgdom = $5(dom).find('img');
|
||
imgdom.attr('src', url);
|
||
imgdom.show();
|
||
}
|
||
function bill_hideimg(dom) {
|
||
var imgdom = $5(dom).find('img');
|
||
imgdom.hide();
|
||
}
|
||
function glb_showadd() {
|
||
var msgdom = $5('.glbaddmsg');
|
||
msgdom.removeClass('close');
|
||
$5('.ceedit').addClass('close');
|
||
if (!Glob.glbmodels) {
|
||
ciyfn.callfunc('getglbpath', {}, function (json) {
|
||
var trees = ciyfn.arr_treemap(json.list, 0);
|
||
Glob.glbmodels = {list:[]};
|
||
var html = '';
|
||
html += fillchild(trees, 0);
|
||
function fillchild(sub, deep) {
|
||
if (!sub)
|
||
return '';
|
||
var cldhtml = '';
|
||
for (var m in sub) {
|
||
if (sub[m].child) {
|
||
var htmlchild = fillchild(sub[m].child, deep + 1);
|
||
if (htmlchild == '')
|
||
continue;
|
||
cldhtml += '<li><a class="glbpath" onclick="glb_loadpath(this, ' + sub[m].id + ')">' + ciyfn.lang(sub[m].name) + '</a>';
|
||
if (sub[m].child) {
|
||
cldhtml += '<ul style="margin-left: '+(deep+1)+'em;">';
|
||
cldhtml += htmlchild;
|
||
cldhtml += '</ul><div class="glbmodel_' + sub[m].id + '"></div>';
|
||
}
|
||
cldhtml += '</li>';
|
||
} else {
|
||
cldhtml += '<li><a class="glbpath" onclick="glb_loadpath(this, ' + sub[m].id + ')">' + ciyfn.lang(sub[m].name) + '</a><div class="glbmodel_' + sub[m].id + '"></div></li>';
|
||
}
|
||
}
|
||
return cldhtml;
|
||
}
|
||
$5('.glbmodels').html(html);
|
||
});
|
||
}
|
||
}
|
||
function glb_loadpath(dom, pathid) {
|
||
if(dom.load)
|
||
return;
|
||
if (ciyfn.throttle(dom)) return;
|
||
ciyfn.callfunc('getglbs', {cpath:pathid}, function (json) {
|
||
dom.load = true;
|
||
Glob.glbmodels = ciyfn.objdeepmerge(Glob.glbmodels, json);
|
||
console.log(Glob);
|
||
var html = '';
|
||
for (var i in json.list) {
|
||
var dat = json.list[i];
|
||
html += '<div onclick="glb_add(' + dat.id + ')" class="name" onmouseenter="glb_showimg(this, \'' + ciyfn.file_stor(dat.url.replace('.glb', '.jpg').replace('.gltf', '.jpg')) + '\')" onmouseleave="glb_hideimg(this)">' + dat.name + '<img style="display:none;" /></div>';
|
||
}
|
||
$5('.glbmodel_' + pathid).html(html);
|
||
});
|
||
}
|
||
function glb_showimg(dom, url) {
|
||
var imgdom = $5(dom).find('img');
|
||
imgdom.attr('src', url);
|
||
imgdom.show();
|
||
}
|
||
function glb_hideimg(dom) {
|
||
var imgdom = $5(dom).find('img');
|
||
imgdom.hide();
|
||
}
|
||
async function bill_add(id) {
|
||
var msgdom = $5('.billaddmsg');
|
||
var form = ciyfn.getform(msgdom[0]);
|
||
var post = ciyfn.ccode(Glob.billmodels.list, id, '_obj');
|
||
post.type = form.type;
|
||
var width = ce.viewer.canvas.clientWidth;
|
||
var height = ce.viewer.canvas.clientHeight;
|
||
var mentity = await ce.addentity({
|
||
type: post.type
|
||
, name: post.name
|
||
, point: { x: width / 2, y: height / 2 }
|
||
, url: ciyfn.file_stor(post.url)
|
||
, w: post.w/1000
|
||
, h: post.h/1000
|
||
});
|
||
console.log(mentity);
|
||
ce.loadentity(mentity);
|
||
ce.selectentity(mentity);
|
||
mentity.ciydata = { name: post.name };
|
||
}
|
||
async function glb_add(id) {
|
||
var post = ciyfn.ccode(Glob.glbmodels.list, id, '_obj');
|
||
post.type = 'model';
|
||
var width = ce.viewer.canvas.clientWidth;
|
||
var height = ce.viewer.canvas.clientHeight;
|
||
// let cartesian = ce.viewer.scene.pickPosition({ x: width / 2, y: height / 2 });
|
||
// let cartst = Cesium.Cartographic.fromCartesian(cartesian);
|
||
// let lng = Cesium.Math.toDegrees(cartst.longitude);
|
||
// let lat = Cesium.Math.toDegrees(cartst.latitude);
|
||
var mentity = await ce.addentity({
|
||
type: post.type
|
||
, name: post.name
|
||
, point: { x: width / 2, y: height / 2 }
|
||
, url: ciyfn.file_stor(post.url)
|
||
});
|
||
ce.loadentity(mentity);
|
||
ce.selectentity(mentity);
|
||
mentity.ciydata = { name: post.name };
|
||
}
|
||
function entity_fill(dat, todom) {
|
||
var html = $5('<div class="flex py2 enty" id="' + dat.id + '"><div class="flex1 px2 name cursor-p" onclick="entity_to(this)">' + entity_fillname(dat.name, dat.bind) + '</div><div><a class="btn xs" onclick="entity_edit(this)">绑定</a> <a class="btn xs dag" onclick="entity_del(this)">删除</a></div></div>');
|
||
delete dat.id;
|
||
html.attr('data-dat', JSON.stringify(dat));
|
||
html.attr('data-bind', dat.bind);
|
||
$5(todom).append(html);
|
||
}
|
||
function entity_to(dom) {
|
||
var divdom = $5(dom).parent('.flex');
|
||
var id = divdom.attr('id');
|
||
var dat = ciyfn.tojson(divdom.attr('data-dat'));
|
||
ce.viewer.flyTo(ce.entitys[id], { offset: new Cesium.HeadingPitchRange(1.57, -0.6, 0) }); //x转90,俯视,距离自动
|
||
ce.loadentity(ce.entitys[id]);
|
||
ce.selectentity(ce.entitys[id]);
|
||
}
|
||
function entity_edit(dom) {
|
||
var divdom = $5(dom).parent('.flex');
|
||
var dat = ciyfn.tojson(divdom.attr('data-dat'));
|
||
ciyfn.alert({
|
||
title: '关联绑定',
|
||
width: 'mb',
|
||
content: document.getElementById("alert_bind").innerHTML,
|
||
fn_showed: function (doc, dom) {
|
||
$5('[name=name]', dom).val(dat.name);
|
||
ciycmp({
|
||
dom: $5('[com=bind]', dom), value: dat.bind, range: Glob.data.binds, first: { id: '', name: '不绑定' },
|
||
onchange: function (val) { $5('[name=name]', dom).val(val.text); },
|
||
onlihtml: function (val, range) {
|
||
if (val.id && $5('[data-bind=\'' + val.id + '\']').length > 0)
|
||
return '<span style="color:#1b8fe6;">' + val.name + '</span>';
|
||
return val.name;
|
||
}
|
||
});
|
||
},
|
||
cb: function (opn) {
|
||
opn.close();
|
||
if (opn.btn == '关闭')
|
||
return;
|
||
if (!opn.inputs.name)
|
||
return ciyfn.toast('请输入名称');
|
||
$5('.name', divdom).html(entity_fillname(opn.inputs.name, opn.inputs.bind));
|
||
divdom.attr('data-bind', opn.inputs.bind);
|
||
dat.name = opn.inputs.name;
|
||
dat.bind = opn.inputs.bind;
|
||
divdom.attr('data-dat', JSON.stringify(dat));
|
||
},
|
||
btns: ['绑定', '*关闭']
|
||
});
|
||
}
|
||
function entity_fillname(name, bind) {
|
||
if (bind) {
|
||
var bindname = ciyfn.ccode(Glob.data.binds, bind);
|
||
if (bindname == name)
|
||
return '<kbd>' + name + '</kbd>';
|
||
else
|
||
return '<kbd>' + bindname + '</kbd>' + name;
|
||
}
|
||
return name;
|
||
}
|
||
function entity_del(dom) {
|
||
ciyfn.alert({
|
||
content: '确认删除?'
|
||
, cb: function (opn) {
|
||
opn.close();
|
||
if (opn.btn == "关闭")
|
||
return;
|
||
var divdom = $5(dom).parent('.flex');
|
||
var id = divdom.attr('id');
|
||
var dat = ciyfn.tojson(divdom.attr('data-dat'));
|
||
divdom.remove();
|
||
ce.viewer.entities.remove(ce.entitys[id]);
|
||
}
|
||
, btns: ["删除", "*关闭"]
|
||
});
|
||
}
|
||
function entity_close(dom) {
|
||
$5(dom).addClass('close');
|
||
$5('.ceedit').removeClass('close');
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
function tile_showadd() {
|
||
var msgdom = $5('.tileaddmsg');
|
||
msgdom.removeClass('close');
|
||
$5('.ceedit').addClass('close');
|
||
}
|
||
function tile_showedit(dom) {
|
||
var divdom = $5(dom).parent('.flex');
|
||
var dat = ciyfn.tojson(divdom.attr('data-dat'));
|
||
var id = divdom.attr('id');
|
||
Glob.tileedit_dom = divdom;
|
||
Glob.tileedit_dat = dat;
|
||
Glob.tileedit_dat.id = id;
|
||
var msgdom = $5('.tileeditmsg');
|
||
msgdom.removeClass('close');
|
||
$5('.ceedit').addClass('close');
|
||
$5('[name=name]', msgdom).val(dat.name);
|
||
$5('[name=height]', msgdom).val(dat.height);
|
||
}
|
||
|
||
function tile_fill(dat) {
|
||
var html = $5('<div class="flex py2" id="' + dat.id + '"><div class="flex1 px2 name cursor-p" onclick="tile_to(this)">' + dat.name + '</div><div><a class="btn xs def" onclick="tile_showedit(this)">调整</a> <a class="btn xs dag" onclick="tile_del(this)">删除</a></div></div>');
|
||
delete dat.id;
|
||
html.attr('data-dat', JSON.stringify(dat));
|
||
$5('.tiles').append(html);
|
||
}
|
||
function tile_to(dom) {
|
||
var divdom = $5(dom).parent('.flex');
|
||
var id = divdom.attr('id');
|
||
var dat = ciyfn.tojson(divdom.attr('data-dat'));
|
||
|
||
var boundingSphere = ce.tiles[id].boundingSphere;
|
||
ce.viewer.camera.viewBoundingSphere(boundingSphere, new Cesium.HeadingPitchRange(0.0, -0.5, boundingSphere.radius));
|
||
ce.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
|
||
}
|
||
function tile_add() {
|
||
var msgdom = $5('.tileaddmsg');
|
||
var post = ciyfn.getform(msgdom[0]);
|
||
if (!post.name)
|
||
return ciyfn.toast('请输入名称');
|
||
post.id = Cesium.createGuid();
|
||
post.success = function (tileset) {
|
||
$5('[name=name]', msgdom).val('');
|
||
$5('[name=localurl]', msgdom).val('');
|
||
$5('[name=url]', msgdom).val('');
|
||
$5('[name=height]', msgdom).val('');
|
||
tile_close();
|
||
var boundingSphere = tileset.boundingSphere;
|
||
ce.viewer.camera.viewBoundingSphere(boundingSphere, new Cesium.HeadingPitchRange(0.0, -0.5, boundingSphere.radius));
|
||
ce.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
|
||
}
|
||
ce.add3dtile(post);
|
||
}
|
||
function tile_edit() {
|
||
var msgdom = $5('.tileeditmsg');
|
||
var post = ciyfn.getform(msgdom[0]);
|
||
if (!post.name)
|
||
return ciyfn.toast('请输入名称');
|
||
Glob.tileedit_dat.name = post.name;
|
||
Glob.tileedit_dat.height = post.height;
|
||
Glob.tileedit_dom.attr('data-dat', JSON.stringify(Glob.tileedit_dat));
|
||
ce.set3dtileheight(ce.tiles[Glob.tileedit_dat.id], toint(post.height));
|
||
$5('.name', Glob.tileedit_dom).text(post.name);
|
||
$5('[name=name]', msgdom).val('');
|
||
$5('[name=height]', msgdom).val('');
|
||
tile_close();
|
||
}
|
||
function tile_del(dom) {
|
||
ciyfn.alert({
|
||
content: '确认删除?'
|
||
, cb: function (opn) {
|
||
opn.close();
|
||
if (opn.btn == "关闭")
|
||
return;
|
||
var divdom = $5(dom).parent('.flex');
|
||
var id = divdom.attr('id');
|
||
var dat = ciyfn.tojson(divdom.attr('data-dat'));
|
||
divdom.remove();
|
||
ce.tiles[id].destroy();
|
||
}
|
||
, btns: ["删除", "*关闭"]
|
||
});
|
||
}
|
||
function tile_close() {
|
||
$5('.tileaddmsg').addClass('close');
|
||
$5('.tileeditmsg').addClass('close');
|
||
$5('.ceedit').removeClass('close');
|
||
}
|
||
function tile_numheight(num) {
|
||
event.stopPropagation();
|
||
var msgdom = $5('.tileeditmsg');
|
||
var height = tofloat($5('[name=height]', msgdom).val());
|
||
height += num;
|
||
$5('[name=height]', msgdom).val(height);
|
||
ce.set3dtileheight(ce.tiles[Glob.tileedit_dat.id], height);
|
||
}
|
||
function tile_setheight() {
|
||
event.stopPropagation();
|
||
var msgdom = $5('.tileeditmsg');
|
||
var post = ciyfn.getform(msgdom[0]);
|
||
ce.set3dtileheight(ce.tiles[Glob.tileedit_dat.id], tofloat(post.height));
|
||
}
|
||
|
||
|
||
function fly_add() {
|
||
var flyjsn = JSON.stringify(ce.getView());
|
||
ciyfn.alert({
|
||
width: 'mb',
|
||
content: '<div class="ciy-form"><label style="min-width:3em;">飞行点名称</label><div><input type="text" name="name" style="width:100%;"/></div></div>',
|
||
cb: function (opn) {
|
||
opn.close();
|
||
if (opn.btn == '关闭')
|
||
return;
|
||
if (!opn.inputs.name)
|
||
return ciyfn.toast('请输入名称');
|
||
fly_fill(opn.inputs.name, flyjsn);
|
||
},
|
||
btns: ['添加', '*关闭']
|
||
});
|
||
}
|
||
function fly_fill(name, flyjsn) {
|
||
var html = $5('<div class="flex py2"><div class="flex1 px2 name cursor-p" onclick="fly_to(this)">' + name + '</div><div><a class="btn xs def" onclick="fly_edit(this)">改名</a> <a class="btn xs def" onclick="fly_setfirst(this)">默认</a> <a class="btn xs dag" onclick="fly_del(this)">删除</a></div></div>');
|
||
html.attr('data-dat', flyjsn);
|
||
$5('.flys').append(html);
|
||
}
|
||
|
||
function fly_to(dom) {
|
||
var divdom = $5(dom).parent('.flex');
|
||
var dat = divdom.attr('data-dat');
|
||
ce.flyTo(ciyfn.tojson(dat), 3);
|
||
}
|
||
function fly_edit(dom) {
|
||
var divdom = $5(dom).parent('.flex').find('.name');
|
||
var name = divdom.text();
|
||
ciyfn.alert({
|
||
width: 'mb',
|
||
content: '<div class="ciy-form"><label style="min-width:3em;">名称</label><div><input type="text" name="name" style="width:100%;"/></div></div>',
|
||
fn_showed: function (doc, dom) {
|
||
$5('[name=name]', dom).val(name);
|
||
},
|
||
cb: function (opn) {
|
||
opn.close();
|
||
if (opn.btn == '关闭')
|
||
return;
|
||
if (!opn.inputs.name)
|
||
return ciyfn.toast('请输入名称');
|
||
$5('.name', divdom).text(opn.inputs.name);
|
||
divdom.text(opn.inputs.name);
|
||
},
|
||
btns: ['改名', '*关闭']
|
||
});
|
||
}
|
||
function fly_del(dom) {
|
||
ciyfn.alert({
|
||
content: '确认删除?'
|
||
, cb: function (opn) {
|
||
opn.close();
|
||
if (opn.btn == "关闭")
|
||
return;
|
||
$5(dom).parent('.flex').remove();
|
||
}
|
||
, btns: ["删除", "*关闭"]
|
||
});
|
||
}
|
||
function fly_setfirst(dom) {
|
||
var divdom = $5(dom).parent('.flex');
|
||
$5('.flys').prepend(divdom);
|
||
}
|
||
ce.ciyevent = function (type, act, data) {
|
||
//model类: entity/3dtile、rightclick/click/change/delete、primitive
|
||
//操作类: control、close/fly/walk
|
||
//飞行中: control、op、certain
|
||
//编辑model类: edit、on/off/op[n]
|
||
//点击: click、left、certain
|
||
//地图: map、movestart/moveend
|
||
|
||
if (type == 'click') {
|
||
console.warn(type, act, data);
|
||
if (typeof (Glob.cb_maploc) == 'function') {
|
||
Glob.cb_maploc(data);
|
||
}
|
||
} else if (type == 'edit') {
|
||
if (act == 'on') {
|
||
$5('.ceeditpanel>div>div').removeClass('select');
|
||
$5('.ceeditpanel').show();
|
||
}
|
||
else if (act == 'off')
|
||
$5('.ceeditpanel').hide();
|
||
else {
|
||
$5('.ceeditpanel>div>div').removeClass('select');
|
||
$5('.ceeditpanel>div>div.' + act).addClass('select');
|
||
}
|
||
} else if (type == 'op') {
|
||
if (act == 'on')
|
||
$5('.ceeditpanel').show();
|
||
else
|
||
$5('.ceeditpanel').hide();
|
||
} else if (type == 'control') {
|
||
if (act == 'walk' || act == 'fly') {
|
||
$5('.ceedit').addClass('close');
|
||
} else if (act == 'op') {
|
||
var htmltip = '';
|
||
if (ce.viewer.flags.walk)
|
||
htmltip += '<kbd>行走</kbd>';
|
||
else
|
||
htmltip += '<kbd>飞行</kbd>';
|
||
var lng = Cesium.Math.toDegrees(data.longitude);
|
||
var lat = Cesium.Math.toDegrees(data.latitude);
|
||
htmltip += '经度:' + lng.toFixed(4) + ' 纬度:' + lat.toFixed(4) + ' 海拔:' + data.height.toFixed(1) + '米';
|
||
if (ce.lastfloorheight > -9999)
|
||
htmltip += ' 高程:' + ce.lastfloorheight.toFixed(1) + '米';
|
||
htmltip += ' 档位:<code style="font-size: 1.3em;">' + ce.viewer.flags.speedbet + '</code>';
|
||
htmltip += ' ';
|
||
Glob.dom_controltip.html(htmltip);
|
||
} else {
|
||
Glob.dom_controltip.html('');
|
||
$5('.cecontrolhelp').hide();
|
||
$5('.ceedit').removeClass('close');
|
||
}
|
||
} else if (type == 'entity') {
|
||
if (act == 'leftclick') {
|
||
console.warn(data.entity.name);
|
||
|
||
} else if (act == 'add') {
|
||
if (data.type == 'model')
|
||
entity_fill(data, '.glbs');
|
||
else if (data.type == 'billboard' || data.type == 'plane')
|
||
entity_fill(data, '.bills');
|
||
} else if (act == 'change') {
|
||
var glbdom = $5('#' + data.id);
|
||
if (glbdom.length == 0)
|
||
return;
|
||
var dat = ciyfn.tojson(glbdom.attr('data-dat'));
|
||
|
||
dat.pos = data.position._value;
|
||
dat.ori = data.orientation._value;
|
||
if (data.ciyw)
|
||
dat.w = data.ciyw;
|
||
if (data.ciyh)
|
||
dat.h = data.ciyh;
|
||
dat.sc = data[data.ciytype].scale ? (data[data.ciytype].scale._value ? data[data.ciytype].scale._value : data[data.ciytype].scale) : 1;
|
||
glbdom.attr('data-dat', JSON.stringify(dat));
|
||
}
|
||
else if (act == 'delete') {
|
||
var entdom = $5('#' + data.id);
|
||
if (entdom.length == 0)
|
||
return;
|
||
entdom.remove();
|
||
}
|
||
else if (act == 'select') {
|
||
$5('.enty').removeClass('active');
|
||
for (var i in data) {
|
||
$5('#' + data[i].id).addClass('active');
|
||
}
|
||
}
|
||
} else if (type == 'tile') {
|
||
if (act == 'add') {
|
||
tile_fill(data);
|
||
}
|
||
}
|
||
};
|
||
|
||
function flysingleimg() {
|
||
var positions = [];
|
||
var pos = $5('[name=my_singleimg_p1]').attr('data').split(',');
|
||
if (pos.length != 2)
|
||
return;
|
||
positions.push(Cesium.Cartesian3.fromRadians(tofloat(pos[0]), tofloat(pos[1]), 0));
|
||
pos = $5('[name=my_singleimg_p2]').attr('data').split(',');
|
||
if (pos.length != 2)
|
||
return;
|
||
positions.push(Cesium.Cartesian3.fromRadians(tofloat(pos[0]), tofloat(pos[1]), 0));
|
||
ce.viewer.camera.flyToBoundingSphere(new Cesium.BoundingSphere.fromPoints(positions), { duration: 1, offset: new Cesium.HeadingPitchRange(0, -1.57, 0) });
|
||
}
|
||
|
||
function getmaploc(dom, tag) {
|
||
event.stopPropagation();
|
||
if ($5(dom).hasClass('def')) {
|
||
Glob.cb_maploc = null;
|
||
$5(dom).removeClass('def');
|
||
$5(dom).removeClass('imp');
|
||
if (tag == 'maskrange') {
|
||
var pts = $5('[name=' + tag + ']').val().split(';');
|
||
if (pts.length < 4) {
|
||
$5('[name=' + tag + ']').val('');
|
||
ciyfn.toast('至少需要3个坐标点');
|
||
return;
|
||
}
|
||
pts.pop();
|
||
$5('[name=' + tag + ']').val(pts.join(';'));
|
||
}
|
||
return;
|
||
} else {
|
||
if (tag == 'data')
|
||
$5(dom).attr('data', '');
|
||
else if (tag == 'maskrange')
|
||
$5('[name=' + tag + ']').val('');
|
||
else if (tag == 'point') {
|
||
|
||
}
|
||
}
|
||
$5(dom).removeClass('imp');
|
||
$5(dom).addClass('def');
|
||
setTimeout(function () {
|
||
Glob.cb_maploc = function (pos) {
|
||
var cartesian = ce.viewer.scene.pickPosition(pos);
|
||
var cartend = Cesium.Cartographic.fromCartesian(cartesian);
|
||
var loc = cartend.longitude + ',' + cartend.latitude;
|
||
if (tag == 'maskrange') {
|
||
var dat = $5('[name=' + tag + ']').val();
|
||
if (dat)
|
||
dat += ';';
|
||
dat += loc;
|
||
$5('[name=' + tag + ']').val(dat);
|
||
} else if (tag == 'data') {
|
||
$5(dom).attr('data', loc);
|
||
$5(dom).removeClass('def');
|
||
$5(dom).addClass('imp');
|
||
Glob.cb_maploc = null;
|
||
} else if (tag == 'point') {
|
||
$5(dom).attr('data', loc);
|
||
$5(dom).removeClass('def');
|
||
$5(dom).addClass('imp');
|
||
Glob.cb_maploc = null;
|
||
}
|
||
};
|
||
}, 500);
|
||
}
|
||
function saveset(dom) {
|
||
var post = ciyfn.getform(dom, null, null, false);
|
||
post.flys = [];
|
||
$5('.flys>div').each(function (dom) {
|
||
var dat = $5(dom).attr('data-dat');
|
||
var name = $5(dom).find('.name').text();
|
||
post.flys.push({ name: name, dat: dat });
|
||
});
|
||
post.tiles = [];
|
||
$5('.tiles>div').each(function (dom) {
|
||
var dat = $5(dom).attr('data-dat');
|
||
dat = ciyfn.tojson(dat);
|
||
delete dat.id;
|
||
post.tiles.push(dat);
|
||
});
|
||
post.entitys = [];
|
||
$5('.glbs>div').each(function (dom) {
|
||
var dat = $5(dom).attr('data-dat');
|
||
dat = ciyfn.tojson(dat);
|
||
delete dat.id;
|
||
post.entitys.push(dat);
|
||
});
|
||
$5('.bills>div').each(function (dom) {
|
||
var dat = $5(dom).attr('data-dat');
|
||
dat = ciyfn.tojson(dat);
|
||
delete dat.id;
|
||
post.entitys.push(dat);
|
||
});
|
||
if(post.my_singleimg_url){
|
||
post.my_singleimg_p1 = $5('[name=my_singleimg_p1]').attr('data');
|
||
post.my_singleimg_p2 = $5('[name=my_singleimg_p2]').attr('data');
|
||
}
|
||
ciyfn.callfunc('save', { tabname: Glob.data.tabname, set: post }, function (json) {
|
||
location.reload();
|
||
});
|
||
}
|
||
ciyfn.pageload(function () {
|
||
try {
|
||
ciyfn.callfunc('init', {}, function (json) {
|
||
Glob.data = json;
|
||
var mapset = ciyfn.tojson(json.cemap.mapjson);
|
||
console.log('mapset', mapset);
|
||
mapset.domid = 'ceContainer';
|
||
mapset.personheight = 1.8;
|
||
mapset.enableedit = true;
|
||
mapset.flys = mapset.flys || [];
|
||
if (mapset.flys.length == 0) {
|
||
var height = 2000.0;
|
||
var position = Cesium.Cartesian3.fromDegrees(tofloat(Glob.data.base.lng), tofloat(Glob.data.base.lat), height);
|
||
mapset.flys.push({ name: '俯视', dat: JSON.stringify({ fd: position, fo: { h: Cesium.Math.toRadians(0.0), p: Cesium.Math.toRadians(-90.0), r: 0.0 } }) });
|
||
}
|
||
ce.init(mapset);
|
||
|
||
$5('[name=ion]').val(mapset.ion || '');
|
||
$5('[name=sunhourmin]').val(mapset.sunhourmin || '');
|
||
ciycmp({
|
||
dom: '[com=wmts_source]', value: mapset.wmts_source || 2, range: [
|
||
{ id: 1, name: '默认地图' }
|
||
, { id: 2, name: '纯色地图' }
|
||
, { id: 3, name: '天地图' }
|
||
, { id: 4, name: '高德地图' }
|
||
, { id: 5, name: '腾讯地图' }
|
||
, { id: 6, name: '百度地图' }],
|
||
initevent: true,
|
||
onchange: val => {
|
||
$5('.wtms_ext').hide();
|
||
$5('.wtms_' + val.value).show('', 0.2, 'flex');
|
||
}
|
||
});
|
||
ciycmp({
|
||
dom: '[com=wmts_style]', value: mapset.wmts_style || 1, range: [
|
||
{ id: 1, name: '卫星地图' }
|
||
, { id: 2, name: '卫星图(标注)' }
|
||
, { id: 3, name: '矢量地图' }]
|
||
});
|
||
|
||
$5('[name=map_color]').val(mapset.map_color);
|
||
$5('[name=tdt_wmts_token]').val(mapset.tdt_wmts_token);
|
||
$5('[name=ion_terrain]').val(mapset.ion_terrain);
|
||
$5('[name=my_terrain]').val(mapset.my_terrain);
|
||
$5('[name=my_wmts]').val(mapset.my_wmts);
|
||
ciycmp({ dom: $5('[com=timeline]'), value: mapset.timeline || 2 });
|
||
|
||
$5('[name=flytime_load]').val(mapset.flytime_load || 5);
|
||
$5('[name=flytime_fly]').val(mapset.flytime_fly || 5);
|
||
ciycmp({ dom: $5('[com=setop]'), value: mapset.setop || 3, range: [{ id: 1, name: '传统操作' }, { id: 2, name: '飞行操作' }, { id: 3, name: '飞行行走' }] });
|
||
ciycmp({ dom: $5('[com=setin]'), value: mapset.setin || 2, range: [{ id: 1, name: '地球飞入' }, { id: 2, name: '中国飞入' }, { id: 3, name: '直接进入' }] });
|
||
ciycmp({ dom: $5('[com=sunshadow]'), value: mapset.sunshadow || 1, range: [{ id: 1, name: '无阴影' }, { id: 2, name: '弱阴影' }, { id: 3, name: '中阴影' }, { id: 4, name: '强阴影' }] });
|
||
|
||
$5('[name=my_singleimg_url]').val(mapset.my_singleimg_url);
|
||
$5('[name=my_singleimg_p1]').attr('data', mapset.my_singleimg_p1);
|
||
if (mapset.my_singleimg_p1)
|
||
$5('[name=my_singleimg_p1]').addClass('imp');
|
||
$5('[name=my_singleimg_p2]').attr('data', mapset.my_singleimg_p2);
|
||
if (mapset.my_singleimg_p2)
|
||
$5('[name=my_singleimg_p2]').addClass('imp');
|
||
|
||
if (mapset.maskopacity === undefined)
|
||
mapset.maskopacity = 1;
|
||
$5('[name=maskrange]').val(mapset.maskrange);
|
||
$5('[name=maskcolor]').val(mapset.maskcolor);
|
||
$5('[name=maskopacity]').val(mapset.maskopacity);
|
||
|
||
for (var i = 0; i < mapset.flys.length; i++) {
|
||
fly_fill(mapset.flys[i].name, mapset.flys[i].dat);
|
||
}
|
||
});
|
||
console.log(Cesium.VERSION);
|
||
} catch (e) {
|
||
console.log('init:', e);
|
||
}
|
||
});
|
||
</script>
|
||
</body>
|
||
|
||
</html> |