|
@@ -36,8 +36,10 @@ $(function () {
|
|
|
{"id": tc_shoufeizhan, "type": "road", label: "收费站", layer: sfzMarkerlayer},
|
|
|
{"id": tc_camera, "type": "camera", label: "公路摄像头", layer: cameraMarkerlayer}
|
|
|
];
|
|
|
-
|
|
|
+ // 添加左边栏图层列表(五项)
|
|
|
getRoadLayerItems(basicType);
|
|
|
+ // 添加地图上图层列表(五项)
|
|
|
+ getMapCheckItems();
|
|
|
getEventItems();
|
|
|
|
|
|
// 调整左边栏显示高度和宽度
|
|
@@ -196,9 +198,13 @@ function getRoadLayerItems(basicType) {
|
|
|
|
|
|
$('.layer.ui.checkbox').checkbox({
|
|
|
onChecked: function () {
|
|
|
+ // 设置左边栏check和地图栏check相关联
|
|
|
+ setCheckRel(this.name, true);
|
|
|
initRoadBasicInfoEvent(this.name, basicType);
|
|
|
},
|
|
|
onUnchecked: function () {
|
|
|
+ // 设置左边栏check和地图栏check相关联
|
|
|
+ setCheckRel(this.name, false);
|
|
|
var targetlayer = $.getBasicLayer(this.name, basicType);
|
|
|
targetlayer.clearMarkers();
|
|
|
//关闭当前对应图层弹出的左下角信息框
|
|
@@ -208,6 +214,65 @@ function getRoadLayerItems(basicType) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * 添加地图图层列表
|
|
|
+ * @param type 表示: 铁 水 公 空
|
|
|
+ */
|
|
|
+function getMapCheckItems() {
|
|
|
+ mapBasicType = [
|
|
|
+ {"id": "map_navi_fwq", "type": "road", label: "服务区", layer: fwqMarkerlayer},
|
|
|
+ {"id": "map_navi_shoufeizhan", "type": "road", label: "收费站", layer: sfzMarkerlayer},
|
|
|
+ {"id": "map_navi_camera", "type": "camera", label: "公路摄像头", layer: cameraMarkerlayer},
|
|
|
+ {"id": "map_tfsjchk", "type": "map", label: "突发事件", icon: "assets/images/tfsj.png"},
|
|
|
+ {"id": "map_yhsgchk", "type": "map", label: "养护施工", icon: "assets/images/yhsg.png"}
|
|
|
+ ];
|
|
|
+ var htmltemplate = '<div class="field"><div class="layer ui checkbox" style="padding: 5px"><input id="{0}" type="checkbox" name="{1}"><label>{2}</label></div></div>';
|
|
|
+ var htmlDiv = "";
|
|
|
+ for (var i = 0; i < mapBasicType.length; i++) {
|
|
|
+ htmlDiv += $.formatString(htmltemplate, mapBasicType[i].id, mapBasicType[i].id, mapBasicType[i].label);
|
|
|
+ }
|
|
|
+ $("#divcheck").html(htmlDiv);
|
|
|
+ $('.layer.ui.checkbox').checkbox({
|
|
|
+ onChecked: function () {
|
|
|
+ var actName = this.name.replace("map_","");
|
|
|
+ // 设置左边栏check和地图栏check相关联
|
|
|
+ setCheckRel(actName, true);
|
|
|
+ if (actName == tc_tfsjchk || actName == tc_yhsgchk) {
|
|
|
+ initEventInfoEvent(actName);
|
|
|
+ } else {
|
|
|
+ initRoadBasicInfoEvent(actName, basicType);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onUnchecked: function () {
|
|
|
+ var actName = this.name.replace("map_","");
|
|
|
+ // 设置左边栏check和地图栏check相关联
|
|
|
+ setCheckRel(actName, false);
|
|
|
+ if (actName == tc_tfsjchk) {
|
|
|
+ tfsjMarkerlayer.clearMarkers();
|
|
|
+ } else if (actName == tc_yhsgchk) {
|
|
|
+ glyhMarkerlayer.clearMarkers();
|
|
|
+ } else {
|
|
|
+ var targetlayer = $.getBasicLayer(actName, basicType);
|
|
|
+ targetlayer.clearMarkers();
|
|
|
+ //关闭当前对应图层弹出的左下角信息框
|
|
|
+ closeUncheckTc(actName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 设置左边栏check和地图栏check相关联
|
|
|
+ */
|
|
|
+function setCheckRel(name, flg) {
|
|
|
+ if(flg == true) {
|
|
|
+ $("#"+name).prop('checked',true);
|
|
|
+ $("#map_"+name).prop('checked',true);
|
|
|
+ } else {
|
|
|
+ $("#"+name).prop('checked',false);
|
|
|
+ $("#map_"+name).prop('checked',false);
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
/**
|
|
|
*初始化基础数据复选框监听
|
|
@@ -516,9 +581,13 @@ function getEventItems() {
|
|
|
|
|
|
$('.event.ui.checkbox').checkbox({
|
|
|
onChecked: function () {
|
|
|
+ // 设置左边栏check和地图栏check相关联
|
|
|
+ setCheckRel(this.name, true);
|
|
|
initEventInfoEvent(this.name);
|
|
|
},
|
|
|
onUnchecked: function () {
|
|
|
+ // 设置左边栏check和地图栏check相关联
|
|
|
+ setCheckRel(this.name, false);
|
|
|
if (this.name == tc_tfsjchk) {
|
|
|
tfsjMarkerlayer.clearMarkers();
|
|
|
} else {
|