You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
125 lines
3.5 KiB
125 lines
3.5 KiB
9 months ago
|
<script
|
||
|
type="text/javascript"
|
||
|
src="SuperMap_WebGL/examples/js/polygon.js"
|
||
|
></script>
|
||
|
<script type="text/javascript" src="subitem/js/yjcz.js"></script>
|
||
|
<script type="text/javascript" src="js/setting.js"></script>
|
||
|
<link href="subitem/css/clfzbs.css" rel="stylesheet" type="text/css" />
|
||
|
<style>
|
||
|
.layui-layer {
|
||
|
background: #0d1535 !important;
|
||
|
}
|
||
|
</style>
|
||
|
<!-- 工具栏 -->
|
||
|
<div class="yjcz-gjl" style="text-align: center">
|
||
|
<ul>
|
||
|
<li>
|
||
|
<a
|
||
|
href="javascript:void(0)"
|
||
|
onclick="clbs_fun()"
|
||
|
class="gjl-icon1"
|
||
|
data-value="0"
|
||
|
>
|
||
|
<div class="yjcz-gjl-icon yjcz-gjl-icon14"></div>
|
||
|
<h4>创建用户</h4>
|
||
|
</a>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<script type="text/javascript">
|
||
|
//标记数组
|
||
|
var addRYIconList = [];
|
||
|
|
||
|
function clbs_fun() {
|
||
|
$(".gjl-icon1").toggleClass("current");
|
||
|
var dataValue = $(".gjl-icon1").attr("data-value");
|
||
|
if (dataValue == "0") {
|
||
|
openCLXZ();
|
||
|
$(".gjl-icon1").attr("data-value", "1");
|
||
|
} else {
|
||
|
_ScreenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK);
|
||
|
$(".gjl-icon1").attr("data-value", "0");
|
||
|
}
|
||
|
}
|
||
|
function openCLXZ() {
|
||
|
var index = layui.layer.open({
|
||
|
title: "角色选择 ",
|
||
|
type: 2,
|
||
|
area: ["640px", "420px"],
|
||
|
shade: 0.4, //遮罩透明度
|
||
|
anim: 1,
|
||
|
maxmin: true,
|
||
|
content: _staticUrl+"subitem/item/jsxz.html",
|
||
|
btn: ["确定", "取消"],
|
||
|
yes: function (index, layero) {
|
||
|
var body = parent.layer.getChildFrame("body", index);
|
||
|
var xueyuan = body.find("#xueyuan").val();
|
||
|
var carSel = body.find("#carSel").val();
|
||
|
var text = carSel;
|
||
|
if (xueyuan != null && xueyuan != "") {
|
||
|
text += "("+xueyuan+")";
|
||
|
}
|
||
|
try {
|
||
|
setPointIcon(text);
|
||
|
} catch (e) {
|
||
|
layer.close(index);
|
||
|
}
|
||
|
layer.close(index);
|
||
|
},
|
||
|
btn2: function () {
|
||
|
$(".gjl-icon1").toggleClass("current");
|
||
|
$(".gjl-icon1").attr("data-value", "0");
|
||
|
layer.close(index);
|
||
|
},
|
||
|
});
|
||
|
}
|
||
|
|
||
|
//点击获取位置
|
||
|
function setPointIcon(name, type) {
|
||
|
_ScreenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
|
||
|
var position = _viewer.scene.pickPosition(movement.position);
|
||
|
if (position != null) {
|
||
|
var cartographic = _cesium.Cartographic.fromCartesian(position);
|
||
|
if (cartographic != null) {
|
||
|
longitude = _cesium.Math.toDegrees(cartographic.longitude);
|
||
|
latitude = _cesium.Math.toDegrees(cartographic.latitude);
|
||
|
var height = cartographic.height;
|
||
|
if (height < 0) {
|
||
|
height = 0;
|
||
|
}
|
||
|
position = _cesium.Cartesian3.fromDegrees(
|
||
|
longitude,
|
||
|
latitude,
|
||
|
height
|
||
|
);
|
||
|
addIcon(name, position, type);
|
||
|
}
|
||
|
}
|
||
|
}, _cesium.ScreenSpaceEventType.RIGHT_CLICK);
|
||
|
}
|
||
|
|
||
|
function addIcon(name, position, type) {
|
||
|
if (type == null || type == "") {
|
||
|
type = "ditu-fk-icon1";
|
||
|
}
|
||
|
|
||
|
//地图添加标注
|
||
|
addEntity_billboardAndLabel(
|
||
|
addRYIconList,
|
||
|
"addRYIconList" + addRYIconList.length,
|
||
|
name == null || name == ""
|
||
|
? "addRYIconList" + addRYIconList.length
|
||
|
: name,
|
||
|
position,
|
||
|
_staticUrl+"icon/" + type + ".png",
|
||
|
new this._cesium.DistanceDisplayCondition(0, 15000.0),
|
||
|
15000.0,
|
||
|
1
|
||
|
);
|
||
|
|
||
|
$(".gjl-icon1").toggleClass("current");
|
||
|
$(".gjl-icon1").attr("data-value", "0");
|
||
|
_ScreenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK);
|
||
|
}
|
||
|
</script>
|