<!DOCTYPE html>
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta name="viewport"
|
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
|
<title>专题数据</title>
|
<script src="./js/lodash.min.js"></script>
|
<link rel="stylesheet" href="./css/index.css">
|
<link rel="stylesheet" href="./js/ztreev3/css/bootstrapStyle/bootstrapStyle.css">
|
<link rel="stylesheet" href="./css/layui-table.css">
|
|
<script>
|
window.onload = function () {
|
var zNodes = [
|
{ id: 1, pId: 0, name: "东部海域地貌", open: true },
|
{ id: 12, pId: 1, name: "生态分区0506" },
|
{ id: 121, pId: 12, name: "一级分区线", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E4%B8%80%E7%BA%A7%E5%88%86%E5%8C%BA%E7%BA%BF" },
|
{ id: 122, pId: 12, name: "二级分区线", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E4%BA%8C%E7%BA%A7%E5%88%86%E5%8C%BA%E7%BA%BF" },
|
{ id: 123, pId: 12, name: "三级分区线", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E4%B8%89%E7%BA%A7%E5%88%86%E5%8C%BA%E7%BA%BF" },
|
{ id: 13, pId: 1, name: "50m等深线" },
|
{ id: 131, pId: 13, name: "近岸浅海交错带", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E8%BF%91%E5%B2%B8%E6%B5%85%E6%B5%B7%E4%BA%A4%E9%94%99%E5%B8%A6" },
|
{ id: 2, pId: 1, name: "陆" },
|
{ id: 20, pId: 2, name: "台湾潮间带", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E5%8F%B0%E6%B9%BE%E6%BD%AE%E9%97%B4%E5%B8%A61" },
|
{ id: 3, pId: 1, name: "908潮间带范围" },
|
{ id: 31, pId: 3, name: "潮间带", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms111/%E6%BD%AE%E9%97%B4%E5%B8%A6" },
|
{ id: 4, pId: 1, name: "海岸带数据整合" },
|
{ id: 41, pId: 4, name: "海草床0318", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E6%B5%B7%E8%8D%89%E5%BA%8A0318" },
|
{ id: 5, pId: 1, name: "生物分区" },
|
{ id: 51, pId: 5, name: "底栖生物群落类型", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E5%BA%95%E6%A0%96%E7%94%9F%E7%89%A9%E7%BE%A4%E8%90%BD" },
|
{ id: 52, pId: 5, name: "底栖生物群落", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E5%BA%95%E6%A0%96%E7%94%9F%E7%89%A9%E7%BE%A4%E8%90%BD" },
|
{ id: 53, pId: 5, name: "底栖生物分区", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E5%BA%95%E6%A0%96%E7%94%9F%E7%89%A9%E5%88%86%E5%8C%BA" },
|
{ id: 6, pId: 1, name: "生物" },
|
{ id: 61, pId: 6, name: "赤潮-黄藻", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E8%B5%A4%E6%BD%AE-%E9%BB%84%E8%97%BB" },
|
{ id: 62, pId: 6, name: "赤潮-蓝藻", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E8%B5%A4%E6%BD%AE-%E8%93%9D%E8%97%BB" },
|
{ id: 63, pId: 6, name: "赤潮-定鞭藻", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E8%B5%A4%E6%BD%AE-%E5%AE%9A%E9%9E%AD%E8%97%BB" },
|
{ id: 64, pId: 6, name: "赤潮-原生动物", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E8%B5%A4%E6%BD%AE-%E5%8E%9F%E7%94%9F%E5%8A%A8%E7%89%A9" },
|
{ id: 65, pId: 6, name: "赤潮-金藻", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E8%B5%A4%E6%BD%AE-%E9%87%91%E8%97%BB" },
|
{ id: 66, pId: 6, name: "赤潮-硅藻", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E8%B5%A4%E6%BD%AE-%E7%A1%85%E8%97%BB" },
|
{ id: 67, pId: 6, name: "赤潮-甲藻", map: 'http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E8%B5%A4%E6%BD%AE-%E7%94%B2%E8%97%BB' },
|
{ id: 68, pId: 6, name: "赤潮-藻华", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E8%97%BB%E5%8D%8E" },
|
{ id: 7, pId: 1, name: "其它" },
|
{ id: 71, pId: 7, name: "图层6", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E5%9B%BE%E5%B1%826" },
|
{ id: 72, pId: 7, name: "图层", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E5%9B%BE%E5%B1%82" },
|
{ id: 73, pId: 7, name: "征求意见修改上报版0702", map: "http://18.1.2.15:8090/iserver/services/map-v10/wms130/%E5%BE%81%E6%B1%82%E6%84%8F%E8%A7%81%E4%BF%AE%E6%94%B9%E4%B8%8A%E6%8A%A5%E7%89%880702" },
|
];
|
|
var zNodes = [
|
{ id: 12, pId: 1, name: "生态区" },
|
{ id: 121, pId: 12, name: "一级分区线", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/5" },
|
{ id: 122, pId: 12, name: "二级分区线", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/6" },
|
{ id: 123, pId: 12, name: "三级分区线", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/7" },
|
{ id: 124, pId: 12, name: "近岸浅海交错带", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/10" },
|
{ id: 125, pId: 12, name: "潮间带", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/12" },
|
{ id: 13, pId: 1, name: "水体组" },
|
{ id: 131, pId: 13, name: "海流" },
|
{ id: 132, pId: 13, name: "温度" },
|
{ id: 133, pId: 13, name: "盐度" },
|
{ id: 3, pId: 1, name: "底质组" },
|
{ id: 31, pId: 3, name: "粒度" },
|
{ id: 32, pId: 3, name: "沉积物" },
|
// { id: 31, pId: 3, name: "潮间带", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/12" },
|
// { id: 4, pId: 1, name: "生物组" },
|
// { id: 41, pId: 4, name: "海草床0318", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/13" },
|
// { id: 5, pId: 1, name: "生物分区" },
|
// { id: 51, pId: 5, name: "底栖生物群落类型", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/15" },
|
// { id: 52, pId: 5, name: "底栖生物群落", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/16" },
|
// { id: 53, pId: 5, name: "底栖生物分区", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/19" },
|
{ id: 6, pId: 1, name: "生物组" },
|
{ id: 61, pId: 6, name: "赤潮-黄藻", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/21" },
|
{ id: 62, pId: 6, name: "赤潮-蓝藻", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/22" },
|
{ id: 63, pId: 6, name: "赤潮-定鞭藻", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/23" },
|
{ id: 64, pId: 6, name: "赤潮-原生动物", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/24" },
|
{ id: 65, pId: 6, name: "赤潮-金藻", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/25" },
|
{ id: 66, pId: 6, name: "赤潮-硅藻", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/26" },
|
{ id: 67, pId: 6, name: "赤潮-甲藻", map: 'http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/27' },
|
{ id: 68, pId: 6, name: "赤潮-藻华", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/28" },
|
{ id: 69, pId: 6, name: "底栖生物群落类型", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/16" },
|
{ id: 691, pId: 6, name: "底栖生物群落类型", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/16" },
|
// { id: 7, pId: 1, name: "其它" },
|
// { id: 73, pId: 7, name: "征求意见修改上报版0702", map: "http://71.3.251.50:6080/arcgis/rest/services/HYHD/linshi/MapServer/0" },
|
{ id: 2, pId: 1, name: "地形地貌组" },
|
{ id: 21, pId: 2, name: "地形图", type: "terrain" },
|
];
|
|
var setting = {
|
data: {
|
view: {
|
showLine: false,
|
|
},
|
simpleData: {
|
enable: true //开启简单数据模式
|
},
|
},
|
view: {
|
addHoverDom: addHoverDom,
|
removeHoverDom: removeHoverDom,
|
},
|
edit: {
|
enable: true,
|
showRemoveBtn: false,
|
showRenameBtn: false,
|
},
|
|
check: {
|
enable: true, //开启复选框
|
chkStyle: 'checkbox',
|
chkboxType: {
|
"Y": "ps",
|
"N": "ps"
|
},
|
},
|
callback: {
|
onCheck: NodeCheckEvent
|
}
|
}
|
|
|
// 查询专题菜单,初始化树结构
|
zTreeObj = $.fn.zTree.init($("#treeDemo"), setting, zNodes); //初始化树
|
|
|
$(".leftclosebtn").on("click", function () {
|
if (parseInt($(this).parent("div").css("left")) >= 0)
|
$(this).parent("div").animate({ "left": "-340px" })
|
else
|
$(this).parent("div").animate({ "left": "10px" })
|
});
|
|
}
|
|
|
// 树的勾选事件
|
var tempTerrain;
|
function NodeCheckEvent(e, treeId, treeNode) {
|
|
if (treeNode.type == "terrain") {
|
var terrainProvidernew = new SFSTerrainProvider({
|
url: 'http://71.3.110.200/sg/Elevation',
|
layerName: 'jgptdem0601hfdx.418648.mpt',
|
requestVertexNormals: true
|
});
|
tempTerrain = sgworld._Viewer.terrainProvider;
|
sgworld._Viewer.terrainProvider = terrainProvidernew;
|
|
return;
|
}
|
|
console.log(treeNode);
|
let obj = {
|
url: 'http://71.3.110.202:6080/arcgis/rest/services/HYHD/HAX/MapServer/0'
|
// url:treeNode.url
|
}
|
// 父节点
|
if (treeNode.isParent && treeNode.checked) {
|
EachChildNode(treeNode, addLayer)
|
}
|
|
if (treeNode.isParent && treeNode.checked == false) {
|
EachChildNode(treeNode, Removelayer)
|
}
|
// 子节点
|
if (treeNode.isParent == false && treeNode.checked) {
|
EachChildNode(treeNode, addLayer)
|
}
|
|
if (treeNode.isParent == false && treeNode.checked == false) {
|
EachChildNode(treeNode, Removelayer)
|
}
|
}
|
|
function EachChildNode(node, callback) {
|
// console.log(node.name);
|
if (node.children) {
|
node.children.map(function (item) {
|
EachChildNode(item, callback)
|
})
|
} else {
|
let obj = {
|
url: node.map
|
}
|
callback && callback(obj)
|
}
|
}
|
//图层创建
|
var Existimglayer = [],
|
ExistimglayerId = []
|
var viewer = window.sgworld.Viewer
|
function addLayer(option) {
|
|
var urlStr = option.url;
|
var layerId = "";
|
// requestLegend(urlStr, option.div);
|
var lastStr = urlStr.substring(urlStr.lastIndexOf("/"));
|
if (lastStr == "WMSServer" || lastStr == "WFSServer" || lastStr == "MapServer") {
|
urlStr = urlStr;
|
} else {
|
layerId = lastStr.substring(1);
|
urlStr = urlStr.substring(0, urlStr.lastIndexOf('/'));
|
}
|
|
if (option.id != undefined) {
|
layerId = option.id
|
}
|
|
if (typeof layerId != 'object') {
|
layerId = [layerId]
|
}
|
|
var layer = new Cesium.ArcGisMapServerImageryProvider({
|
url: urlStr,
|
layers: layerId,
|
// enablePickFeatures: false
|
});
|
|
// var layer = new Cesium.WebMapServiceImageryProvider({
|
// //url: "http://18.1.2.15:8090/iserver/services/map-MXDtoSMWU_1/arcgisrest/%E5%9B%BE%E5%B1%82/MapServer",
|
// url: option.url,
|
// enablePickFeatures: false,
|
// layers: "0",
|
// proxy: new Cesium.DefaultProxy('/proxy/')
|
// });
|
|
|
var imaglayer = new Cesium.ImageryLayer(layer, {})
|
Existimglayer.push(imaglayer)
|
window.sgworld._Viewer.imageryLayers.add(imaglayer);
|
|
};
|
|
//图层删除
|
function Removelayer(option) {
|
if (option.id == undefined) {
|
Existimglayer.forEach(function (params) {
|
if (option.url == params.imageryProvider.url + params.imageryProvider.layers[0]) {
|
window.sgworld._Viewer.imageryLayers.remove(params);
|
}
|
})
|
} else {
|
Existimglayer.forEach(function (params) {
|
if (params.imageryProvider.layers == option.id) {
|
window.sgworld._Viewer.imageryLayers.remove(params);
|
}
|
})
|
}
|
|
}
|
|
</script>
|
|
<body>
|
<!-- 左侧树部分 -->
|
<div id="containbox">
|
<div class="leftclosebtn" style="top:35%"></div>
|
<!-- 专题数据描述 -->
|
<div class="leftwindow" id="leftwindow">
|
<div class="ztms">生态特征层</div>
|
<div id="treeDemo" class="ztree"></div>
|
</div>
|
</div>
|
<!-- 球体 -->
|
<div id="cesiumContainer"></div>
|
|
|
<script src="./SmartEarthSDK/Workers/jquery-2.0.3.js"></script>
|
<script src="./SmartEarthSDK/Cesium/Cesium.js"></script>
|
<script src="./SmartEarthSDK/SmartEarth.min.js"></script>
|
<script src="./2d/js/TETerrainProviderSeven.js"></script>
|
<script src="./js/ztreev3/js/jquery.ztree.all.min.js"></script>
|
<script src="./js/layui-v2.6.7/layui/layui.js"></script>
|
<script src="./js/jquery-ui.min.js"></script>
|
<script src="./js/echarts.min.js"></script>
|
<script src="./js/tanchaung.js"></script>
|
<script src="./js/index1.js"></script>
|
</body>
|
|
</html>
|