//基础功能
|
// 按钮
|
function bindPOI(val) {
|
let show;
|
map.control.geocoder.show = val
|
if (val){
|
show = 1
|
}else{
|
show = 0;
|
}
|
let data = "sousuo="+show
|
$.post("/hxzkuwb/UpdateHomeSettingShow",data,function (data){
|
if (data == 1){
|
notify.success("设置成功")
|
}else{
|
notify.error("设置失败")
|
}
|
})
|
}
|
// 视角复位
|
function bindView(val) {
|
let show;
|
map.control.homeButton.show = val
|
if (val){
|
show = 1
|
}else{
|
show = 0;
|
}
|
let data = "shijiao="+show
|
$.post("/hxzkuwb/UpdateHomeSettingShow",data,function (data){
|
if (data == 1){
|
notify.success("设置成功")
|
}else{
|
notify.error("设置失败")
|
}
|
})
|
}
|
|
// 全屏切换
|
function bindFullScreen(val) {
|
let show;
|
map.control.fullscreenButton.show = val
|
if (val){
|
show = 1
|
}else{
|
show = 0;
|
}
|
let data = "quanping="+show
|
$.post("/hxzkuwb/UpdateHomeSettingShow",data,function (data){
|
if (data == 1){
|
notify.success("设置成功")
|
}else{
|
notify.error("设置失败")
|
}
|
})
|
}
|
|
// 帮助按钮
|
function bindHelpButton(val) {
|
let show;
|
map.control.navigationHelpButton.show = val
|
if (val){
|
show = 1
|
}else{
|
show = 0;
|
}
|
let data = "bangzhu="+show
|
$.post("/hxzkuwb/UpdateHomeSettingShow",data,function (data){
|
if (data == 1){
|
notify.success("设置成功")
|
}else{
|
notify.error("设置失败")
|
}
|
})
|
}
|
|
//缩放
|
function bindZoom(val) {
|
let show;
|
map.control.zoom.show = val
|
if (val){
|
show = 1
|
}else{
|
show = 0;
|
}
|
let data = "suofang="+show
|
$.post("/hxzkuwb/UpdateHomeSettingShow",data,function (data){
|
if (data == 1){
|
notify.success("设置成功")
|
}else{
|
notify.error("设置失败")
|
}
|
})
|
}
|
|
// 面板:
|
// 信息状态栏
|
function bindLocation(val) {
|
let show;
|
map.control.locationBar.show = val
|
if (val){
|
show = 1
|
}else{
|
show = 0;
|
}
|
let data = "weizhi="+show
|
$.post("/hxzkuwb/UpdateHomeSettingShow",data,function (data){
|
if (data == 1){
|
notify.success("设置成功")
|
}else{
|
notify.error("设置失败")
|
}
|
})
|
}
|
|
// 时钟
|
function bindClock(val) {
|
// map.control.clockAnimate.show = val
|
notify.warning("维护中")
|
}
|
|
// 时间刻度线
|
function bindTimeLine(val) {
|
// map.control.timeline.show = val
|
notify.warning("维护中")
|
}
|
|
// 导航球
|
function bindNav(val) {
|
let show;
|
map.control.compass.show = val
|
if (val){
|
show = 1
|
}else{
|
show = 0;
|
}
|
let data = "daohang="+show
|
$.post("/hxzkuwb/UpdateHomeSettingShow",data,function (data){
|
if (data == 1){
|
notify.success("设置成功")
|
}else{
|
notify.error("设置失败")
|
}
|
})
|
}
|
|
// 比例尺
|
function bindLegend(val) {
|
let show;
|
map.control.distanceLegend.show = val
|
if (val){
|
show = 1
|
}else{
|
show = 0;
|
}
|
let data = "rule="+show
|
$.post("/hxzkuwb/UpdateHomeSettingShow",data,function (data){
|
if (data == 1){
|
notify.success("设置成功")
|
}else{
|
notify.error("设置失败")
|
}
|
})
|
}
|
//夜间模式
|
function bindNight(val) {
|
let show;
|
let maskDiv = document.getElementById("maskDiv")
|
let menu = document.getElementById("Menu");
|
let bootom = document.getElementById("MenuBootom")
|
let gongjulan = document.getElementsByClassName("YeJian")
|
let gongjulanzi = document.getElementsByClassName("GongJuLanZi")
|
let acd = document.getElementById("acd")
|
let refer = document.getElementById("refer") //刷新
|
let close = document.getElementById("close") //关闭
|
let context1 = document.getElementById("context1") //文字
|
let send = document.getElementById("send")//发送
|
let borderWhites = document.getElementsByClassName("borderWhites")
|
let whites = document.getElementsByClassName("whites")
|
map.control.distanceLegend.show = val
|
if (val) {
|
show = 1
|
//替换夜间模式
|
maskDiv.style.backgroundImage = 'radial-gradient(rgba(139, 138, 138, 0.219) 50%, rgba(1, 1, 1, 0.8) 80%, rgba(17, 16, 16, 0.9) 90%)';
|
menu.style.backgroundImage = "url('icon/top.png')";
|
bootom.style.backgroundImage="url('icon/bootom.png')";
|
for (let i = 0 ; i <gongjulan.length;i++){
|
gongjulan[i].style.backgroundColor = "rgba(1, 1, 1, 0.5)";
|
gongjulan[i].style.border = "1px solid #666";
|
gongjulan[i].style.color = "white";
|
gongjulan[i].style.backgroundColor = "rgba(1, 1, 1, 0.5)";
|
gongjulanzi[i].style.backgroundColor = "rgba(1, 1, 1, 0.8)";
|
}
|
for (let i = 0 ; i <borderWhites.length; i++){
|
borderWhites[i].style.backgroundImage = "url('icon/borders.png')";
|
}
|
for (let i = 0 ; i <whites.length; i++){
|
whites[i].style.backgroundColor = "rgba(1,1,1,0.5)";
|
}
|
acd.style.backgroundImage="url('icon/border.png')";
|
refer.style.backgroundColor = "rgba(1,1,1,0.5)";
|
close.style.backgroundColor = "rgba(1,1,1,0.5)";
|
context1.style.backgroundColor = "rgba(1,1,1,0.5)";
|
context1.style.border = "none"
|
send.style.backgroundColor = "rgba(1,1,1,1)";
|
send.style.border = "1px solid rgba(1,1,1) "
|
} else {
|
show = 0;
|
//替换正常模式
|
maskDiv.style.backgroundImage = 'radial-gradient(rgba(139, 138, 138, 0.219) 50%, rgba(44, 74, 116, 0.8) 80%, rgba(71, 94, 125, 0.9) 90%)';
|
menu.style.backgroundImage = "url('icon/topwhite.png')";
|
bootom.style.backgroundImage="url('icon/bootomwhite.png')";
|
for (let i = 0 ; i <gongjulan.length;i++){
|
gongjulan[i].style.backgroundColor = "rgba(112, 145, 168, 0.7)";
|
gongjulanzi[i].style.backgroundColor = "rgba(76,213,254,0.7)";
|
gongjulan[i].style.color = "white";
|
}
|
for (let i = 0 ; i <borderWhites.length; i++){
|
borderWhites[i].style.backgroundImage = "url('icon/borderswhite.png')";
|
}
|
for (let i = 0 ; i <whites.length; i++){
|
whites[i].style.backgroundColor = "rgba(76,213,254,0.5)";
|
}
|
acd.style.backgroundImage="url('icon/borderwhite.png')";
|
refer.style.backgroundColor = "rgba(76,213,254,0.5)";
|
close.style.backgroundColor = "rgba(76,213,254,0.5)";
|
context1.style.backgroundColor = "rgba(76,213,254,0.5)";
|
context1.style.border = "1px solid rgba(76,213,254) "
|
send.style.border = "1px solid rgba(76,213,254) "
|
send.style.backgroundColor = "rgba(76,213,254,0.5)";
|
}
|
let data = "zhuti="+show
|
$.post("/hxzkuwb/UpdateHomeSettingShow",data,function (data){
|
if (data == 1){
|
notify.success("设置成功")
|
}else{
|
notify.error("设置失败")
|
}
|
})
|
}
|
|
function initUI(options) {
|
//显示clock
|
$("#showClock").change(function () {
|
var val = $(this).is(":checked")
|
bindClock(val)
|
})
|
|
//显示刻度线
|
$("#showTimeLine").change(function () {
|
var val = $(this).is(":checked")
|
bindTimeLine(val)
|
})
|
|
//位置信息状态栏
|
$("#showLocation").change(function () {
|
var val = $(this).is(":checked")
|
bindLocation(val)
|
})
|
|
//导航球
|
$("#showNav").change(function () {
|
var val = $(this).is(":checked")
|
bindNav(val)
|
})
|
|
// 显示地图缩放
|
$("#zoomButton").change(function () {
|
var val = $(this).is(":checked")
|
bindZoom(val)
|
})
|
|
//比例尺
|
$("#showLegend").change(function () {
|
var val = $(this).is(":checked")
|
bindLegend(val)
|
})
|
|
//显示位置搜索
|
$("#showLocationSearch").change(function () {
|
var val = $(this).is(":checked")
|
bindPOI(val)
|
})
|
//显示回主页
|
$("#showGoHome").change(function () {
|
var val = $(this).is(":checked")
|
bindView(val)
|
})
|
|
//全屏切换
|
$("#showFullScreen").change(function () {
|
var val = $(this).is(":checked")
|
bindFullScreen(val)
|
})
|
|
//显示帮助
|
$("#showHelpButton").change(function () {
|
var val = $(this).is(":checked")
|
bindHelpButton(val)
|
})
|
//夜间模式
|
$("#AnHeiMoShi").change(function (){
|
var val = $(this).is(":checked")
|
bindNight(val)
|
})
|
}
|