new CusScrollBar({
|
contentSelector: '.scroll_cont1', //滚动内容区
|
barSelector: '.scroll_bar1', //滚动条
|
sliderSelector: '.scroll_slider1' //滚动滑块
|
});
|
sgworld = window.external.createSgworld();
|
var urlPathName = "";
|
var form = null;
|
layui.use('form', function () {
|
form = layui.form;
|
var timeStr = decodeURI(getUrlParam("tm"));
|
urlPathName = decodeURI(getUrlParam("urlPathName"));
|
GetSk(timeStr, urlPathName);
|
form.on('checkbox(All)', function (data) {
|
let currentTime = data.elem.title;
|
let layerId = sgworld.ProjectTree.FindItem(urlPathName + "\\" + currentTime + "\\" + currentTime);
|
let layer = sgworld.ProjectTree.GetObject(layerId);
|
let Hex = data.elem.value; //colorRGBtoHex(data.elem.value);
|
layer.FeatureGroups.Item(0).SetProperty('Line Color', Hex);
|
if (data.elem.checked == true) {
|
sgworld.ProjectTree.SetVisibility(layerId, true);
|
} else {
|
sgworld.ProjectTree.SetVisibility(layerId, false);
|
}
|
|
});
|
|
});
|
;
|
|
//获取色块值并且展示出来
|
function GetSk(parm0, parm1) {
|
var timeArr = parm0.split('+');
|
let html = "";
|
for (var i = 0; i < timeArr.length; i++) {
|
var R = parseInt(Math.random() * 255);
|
var G = parseInt(Math.random() * 255);
|
var B = parseInt(Math.random() * 255);
|
let CurrentColor = getRandomColor();
|
|
|
html += '<input type="checkbox" name="message" lay-skin="primary" lay-filter="All" title="' + timeArr[i] + '" value="' + CurrentColor + '">';
|
|
//if (timeArr[i] == "2012") {
|
// let RGB = colorRgb("#EA0000");
|
// //alert(RGB);
|
// html += '<input type="checkbox" name="message" lay-skin="primary" lay-filter="All" title="' + timeArr[i] + '" value="RGB(' + RGB + ')">';
|
//}
|
//if (timeArr[i] == "2013") {
|
// let RGB = colorRgb("#f8aba6");
|
// html += '<input type="checkbox" name="message" lay-skin="primary" lay-filter="All" title="' + timeArr[i] + '" value="RGB(' + RGB + ')">';
|
//}
|
//if (timeArr[i] == "2014") {
|
// let RGB = colorRgb("#46A3FF");
|
// html += '<input type="checkbox" name="message" lay-skin="primary" lay-filter="All" title="' + timeArr[i] + '" value="RGB(' + RGB + ')">';
|
//}
|
//if (timeArr[i] == "2015") {
|
// let RGB = colorRgb("#00FFFF");
|
// html += '<input type="checkbox" name="message" lay-skin="primary" lay-filter="All" title="' + timeArr[i] + '" value="RGB(' + RGB + ')">';
|
//}
|
//if (timeArr[i] == "2016") {
|
// let RGB = colorRgb("#00DB00");
|
// html += '<input type="checkbox" name="message" lay-skin="primary" lay-filter="All" title="' + timeArr[i] + '" value="RGB(' + RGB + ')">';
|
//}
|
//if (timeArr[i] == "2017") {
|
// let RGB = colorRgb("#F9F900");
|
// html += '<input type="checkbox" name="message" lay-skin="primary" lay-filter="All" title="' + timeArr[i] + '" value="RGB(' + RGB + ')">';
|
//}
|
//if (timeArr[i] == "2018") {
|
// let RGB = colorRgb("#FF8000");
|
// html += '<input type="checkbox" name="message" lay-skin="primary" lay-filter="All" title="' + timeArr[i] + '" value="RGB(' + RGB + ')">';
|
//}
|
//if (timeArr[i] == "2019") {
|
// let RGB = colorRgb("#9b95c9");
|
// html += '<input type="checkbox" name="message" lay-skin="primary" lay-filter="All" title="' + timeArr[i] + '" value="RGB(' + RGB + ')">';
|
//}
|
|
if (i == timeArr.length - 1) {
|
//html += '<input type="checkbox" name="message" lay-skin="primary" lay-filter="All" checked="checked" title="' + timeArr[i] + '" value="RGB(4,143,248)">';
|
let layerId = sgworld.ProjectTree.FindItem(urlPathName + "\\" + timeArr[i] + "\\" + timeArr[i]);
|
let layer = sgworld.ProjectTree.GetObject(layerId);
|
layer.FeatureGroups.Item(0).SetProperty('Line Color', CurrentColor);
|
}
|
// else {
|
// html += '<input type="checkbox" name="message" lay-skin="primary" lay-filter="All" title="' + timeArr[i] + '" value="RGB(' + R + ',' + G + ',' + B + ')">';
|
//}
|
|
}
|
$(".message").empty();
|
$(".message").append(html);
|
form.render();
|
}
|
|
|
function getRandomColor(){
|
var str = "#";
|
var arr = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
|
for (var i = 0; i < 6; i++) {
|
var num = parseInt(Math.random() * 16);
|
str += arr[num];
|
}
|
return str;
|
}
|