From 18e1ebbf52aff6284869c634d14f77ed250272d1 Mon Sep 17 00:00:00 2001
From: qinbo <qinbo@shsening.com>
Date: 星期日, 26 九月 2021 09:32:15 +0800
Subject: [PATCH] change layer add time
---
js/function.js | 561 +++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 399 insertions(+), 162 deletions(-)
diff --git a/js/function.js b/js/function.js
index be9c7b9..53f7f34 100644
--- a/js/function.js
+++ b/js/function.js
@@ -49,21 +49,31 @@
(day > 9 ? day : ("0" + day)) + " " +
(hours > 9 ? hours : ("0" + hours)) + ":00:00";
}
-console.log(mars3d.globel_variables);
-mars3d.globel_variables = { geoserver_url_predix: 'http://58.246.27.194:7011/', userid: 2, queryDataType: 'hour' };
-mars3d.globel_variables.queryDataTStart = getDefaultDateTime();
-mars3d.globel_variables.queryDataTEnd = getDefaultDateTime();
-mars3d.globel_variables.layer100600_conifg = { name: '琛楅亾', styleoptions: ['pm25', 'pm10'], selectedstyle: 'pm25' };
-console.log(mars3d.globel_variables);
+// console.log(mars3d.global_variables);
+mars3d.global_variables = { geoserver_url_predix: 'http://58.246.27.194:7011/', userid: 2, queryDataType: 'hour' };
+mars3d.global_variables.queryDataTStart = getDefaultDateTime();
+mars3d.global_variables.queryDataTEnd = getDefaultDateTime();
+聽聽mars3d.global_variables.layer1001_conifg={name:'鍥芥帶鐐�',styleoptions:['pm25','pm10','no','no2','nox','co'],selectedstyle:'pm25',show:false};
+聽聽mars3d.global_variables.layer1002_conifg={name:'寰珯',styleoptions:['pm25','pm10','no','no2','nox','co','p_01'],selectedstyle:'pm25',show:false};
+聽聽mars3d.global_variables.layer1003_conifg={name:'鐩戞祴鐐�',styleoptions:['p_01'],selectedstyle:'p_01',show:false};
+聽聽mars3d.global_variables.layer1005_conifg={name:'涓婃捣甯傞亾璺�',styleoptions:['pm25','pm10','no','no2','nox','co'],selectedstyle:'pm25',show:false};
+聽聽mars3d.global_variables.layer100600_conifg={name:'鏈哄満',styleoptions:['pm25','pm10','no','no2','nox','co'],selectedstyle:'pm25',show:false};
+聽聽mars3d.global_variables.layer100601_conifg={name:'鐮佸ご',styleoptions:['pm25','pm10','no','no2','nox','co'],selectedstyle:'pm25',show:false};
+聽聽mars3d.global_variables.layer100602_conifg={name:'鐜嚎',styleoptions:['pm25','pm10','no','no2','nox','co'],selectedstyle:'pm25',show:false};
+聽聽mars3d.global_variables.layer100603_conifg={name:'宸ヤ笟鍥尯',styleoptions:['pm25','pm10','no','no2','nox','co'],selectedstyle:'pm25',show:false};
+聽聽mars3d.global_variables.layer100604_conifg={name:'杩涘崥浼�',styleoptions:['pm25','pm10','no','no2','nox','co'],selectedstyle:'pm25',show:false};
+聽聽mars3d.global_variables.layer100605_conifg={name:'杈圭晫',styleoptions:['pm25','pm10','no','no2','nox','co'],selectedstyle:'pm25',show:false};
+聽聽mars3d.global_variables.layer100607_conifg={name:'瀹濆北鍦�',styleoptions:['pm25','pm10','no','no2','nox','co'],selectedstyle:'pm25',show:false};
+聽聽mars3d.global_variables.layer100610_conifg={name:'琛屾斂鍖�',styleoptions:['pm25','pm10','no','no2','nox','co'],selectedstyle:'pm25',show:false};
+聽聽mars3d.global_variables.layer100611_conifg={name:'琛楅亾',styleoptions:['pm25','pm10','no','no2','nox','co'],selectedstyle:'pm25',show:false};
+聽聽mars3d.global_variables.layer1000_conifg={name:'缃戞牸鍥惧眰1000',styleoptions:['pm25','pm10','no','no2','nox','co'],selectedstyle:'pm25',show:false};
+聽聽mars3d.global_variables.layer5000_conifg={name:'缃戞牸鍥惧眰5000',styleoptions:['pm25','pm10','no','no2','nox','co'],selectedstyle:'pm25',show:false};
-mars3d.reloadLayers = function (layerid){
-
- if (layerid ==100611) {
- addJiedaoLayer();
- }
-
-};
-
+// mars3d.reloadLayers = function (layerid){
+// if (layerid == 100611) {
+// addJiedaoLayer();
+// }
+// };
function addTDTAnnoLayer() {
@@ -88,11 +98,27 @@
function addguokongLayers(datatime) {
+ let Layer = map.getLayerById(1001);
+ if (Layer) {
+ mars3d.global_variables.layer1002_conifg.show = Layer.options.show;
+
+ map.removeLayer(Layer, true);
+ Layer = null;
+ };
+
layer_1001_guokong = new mars3d.layer.DivLayer({
- name: '鍥芥帶鐐�',
+ id:1001,
+ name: mars3d.global_variables.layer1001_conifg.name,
pid: 99, //鍥惧眰绠$悊 涓娇鐢紝鐖惰妭鐐筰d
- selectedMapStyleOptions: 'pm25',
- hasMapStyleOptions: ['pm25', 'pm10', 'no', 'no2', 'nox', 'co']
+ selectedMapStyleOptions: mars3d.global_variables.layer1001_conifg.selectedstyle,
+ hasMapStyleOptions: mars3d.global_variables.layer1001_conifg.styleoptions,
+ show:mars3d.global_variables.layer1001_conifg.show,
+ reloadLayers:function(new_style){
+ console.log(new_style);
+ console.log(mars3d.global_variables.layer1001_conifg.show);
+ mars3d.global_variables.layer1001_conifg.selectedstyle = new_style;
+ addguokongLayers();
+ }
});
map.addLayer(layer_1001_guokong);
@@ -129,7 +155,7 @@
// add 鍥芥帶鐐�
- $.getJSON("http://58.246.27.194:7012/dataapi/Bdata?bid=get_1001_list_hour&datatime=2021-09-06%2012:00:00&qindex=pm25", (result) => {
+ $.getJSON("http://58.246.27.194:7012/dataapi/Bdata?bid=get_1001_list_"+mars3d.global_variables.queryDataType+"&datatime="+mars3d.global_variables.queryDataTStart+"&qindex="+mars3d.global_variables.layer1001_conifg.selectedstyle, (result) => {
var pointColorArr = ["#f33349", "#fff000", "#33347f"];
for (var i = 0, len = result.data.result.length; i < len; i++) {
var item = result.data.result[i];
@@ -165,21 +191,30 @@
function addWeizhanLayer() {
+ let Layer = map.getLayerById(1002);
+ if (Layer) {
+ mars3d.global_variables.layer1002_conifg.show = Layer.options.show;
+ map.removeLayer(Layer, true);
+ Layer = null;
+ };
+
//鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
layer_1002_weizhan = new mars3d.layer.WmsLayer({
+ id:1002,
pid: 99,
- name: "寰珯",
+ name: mars3d.global_variables.layer1002_conifg.name,
type: "wms",
- url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
- layers: "konglu_58:vis_weizhan_hour",
+ url: mars3d.global_variables.geoserver_url_predix+"/geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_weizhan_"+mars3d.global_variables.queryDataType,
crs: "EPSG:4326",
parameters: {
- "Styles": "point_weizhan_pm25",
+ "styles": "point_weizhan_"+mars3d.global_variables.layer1002_conifg.selectedstyle,
"transparent": "true",
"format": "image/png",
- "sld": "http://127.0.0.1:8080/geoserver/styles/point_weizhan_pm25.sld"
+ "viewparams": "userid:" + mars3d.global_variables.userid + ";datatime:" + mars3d.global_variables.queryDataTStart
+
},
- center: { "lat": 30.429987, "lng": 121.590473, "alt": 58635, "heading": 359, "pitch": -40 },
+ // center: { "lat": 30.429987, "lng": 121.590473, "alt": 58635, "heading": 359, "pitch": -40 },
getFeatureInfoParameters: {
feature_count: 10
},
@@ -195,11 +230,18 @@
}),
},
popup: "all",
- show: false,
- selectedMapStyleOptions: 'pm25',
- hasMapStyleOptions: ['pm25', 'pm10', 'no', 'no2', 'nox', 'co'],
- flyTo: true
+ show: mars3d.global_variables.layer1002_conifg.show,
+ selectedMapStyleOptions: mars3d.global_variables.layer1002_conifg.selectedstyle,
+ hasMapStyleOptions: mars3d.global_variables.layer1002_conifg.styleoptions,
+ flyTo: false,
+ reloadLayers:function(new_style){
+ console.log(new_style);
+ console.log(mars3d.global_variables.layer1002_conifg.show);
+ mars3d.global_variables.layer1002_conifg.selectedstyle = new_style;
+ addWeizhanLayer();
+ }
});
+
//鍗曞嚮浜嬩欢
layer_1002_weizhan.on(mars3d.EventType.click, function (event) {
@@ -212,21 +254,31 @@
function addJianceLayer() {
+ let Layer = map.getLayerById(1003);
+ if (Layer) {
+ mars3d.global_variables.layer1002_conifg.show = Layer.options.show;
+
+ map.removeLayer(Layer, true);
+ Layer = null;
+ };
+
//鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
layer_1003_jiance = new mars3d.layer.WmsLayer({
+ id:1003,
pid: 99,
- name: "鐩戞祴鐐�",
+ name: mars3d.global_variables.layer1003_conifg.name,
type: "wms",
- url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
- layers: "konglu_58:vis_weizhan_hour",
+ url: mars3d.global_variables.geoserver_url_predix+"/geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_weizhan_"+mars3d.global_variables.queryDataType,
crs: "EPSG:4326",
parameters: {
- "Styles": "point_weizhan_pm25",
+ "Styles": "point_jiance_"+mars3d.global_variables.layer1003_conifg.selectedstyle,
"transparent": "true",
"format": "image/png",
- "sld": "http://127.0.0.1:8080/geoserver/styles/point_weizhan_pm25.sld"
+ "viewparams": "userid:" + mars3d.global_variables.userid + ";datatime:" + mars3d.global_variables.queryDataTStart
+
},
- center: { "lat": 30.429987, "lng": 121.590473, "alt": 58635, "heading": 359, "pitch": -40 },
+ // center: { "lat": 30.429987, "lng": 121.590473, "alt": 58635, "heading": 359, "pitch": -40 },
getFeatureInfoParameters: {
feature_count: 10
},
@@ -242,10 +294,16 @@
}),
},
popup: "all",
- show: false,
- selectedMapStyleOptions: 'pm25',
- hasMapStyleOptions: ['pm25', 'pm10', 'no', 'no2', 'nox', 'co'],
- flyTo: true
+ show: mars3d.global_variables.layer1003_conifg.show,
+ selectedMapStyleOptions: mars3d.global_variables.layer1003_conifg.selectedstyle,
+ hasMapStyleOptions: mars3d.global_variables.layer1003_conifg.styleoptions,
+ flyTo: false,
+ reloadLayers:function(new_style){
+ console.log(new_style);
+ console.log(mars3d.global_variables.layer1003_conifg.show);
+ mars3d.global_variables.layer1003_conifg.selectedstyle = new_style;
+ addJianceLayer();
+ }
});
//鍗曞嚮浜嬩欢
@@ -260,21 +318,31 @@
function addRoadLayer() {
+ let Layer = map.getLayerById(1005);
+ if (Layer) {
+ mars3d.global_variables.layer1002_conifg.show = Layer.options.show;
+
+ map.removeLayer(Layer, true);
+ Layer = null;
+ };
+
//鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
layer_1005_roadsection = new mars3d.layer.WmsLayer({
+ id:1005,
pid: 99,
- name: "涓婃捣甯傞亾璺�",
+ name:mars3d.global_variables.layer1005_conifg.name,
type: "wms",
- url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
- layers: "konglu_58:vis_roadsection_hour",
+ url: mars3d.global_variables.geoserver_url_predix+"geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_roadsection_"+mars3d.global_variables.queryDataType,
crs: "EPSG:4326",
parameters: {
- "Stayle": "polyline_road_pm25",
+ "Styles": "polyline_road_"+mars3d.global_variables.layer1005_conifg.selectedstyle,
"transparent": "true",
"format": "image/png",
- "sld": "http://127.0.0.1:8080/geoserver/styles/polyline_road_pm25.sld"
+ "viewparams": "userid:" + mars3d.global_variables.userid + ";datatime:" + mars3d.global_variables.queryDataTStart
+
},
- center: { "lat": 30.487351, "lng": 121.613269, "alt": 54033, "heading": 359, "pitch": -40 },
+ // center: { "lat": 30.487351, "lng": 121.613269, "alt": 54033, "heading": 359, "pitch": -40 },
getFeatureInfoParameters: {
feature_count: 10
},
@@ -290,10 +358,16 @@
}),
},
popup: "all",
- show: false,
- selectedMapStyleOptions: 'pm25',
- hasMapStyleOptions: ['pm25', 'pm10', 'no', 'no2', 'nox', 'co'],
- flyTo: true
+ show: mars3d.global_variables.layer1005_conifg.show,
+ selectedMapStyleOptions: mars3d.global_variables.layer1005_conifg.selectedstyle,
+ hasMapStyleOptions: mars3d.global_variables.layer1005_conifg.styleoptions,
+ flyTo: false,
+ reloadLayers:function(new_style){
+ console.log(new_style);
+ console.log(mars3d.global_variables.layer1005_conifg.show);
+ mars3d.global_variables.layer1005_conifg.selectedstyle = new_style;
+ addRoadLayer();
+ }
});
//鍗曞嚮浜嬩欢
@@ -309,21 +383,31 @@
function addJichangLayer() {
+ let Layer = map.getLayerById(100600);
+ if (Layer) {
+ mars3d.global_variables.layer1002_conifg.show = Layer.options.show;
+
+ map.removeLayer(Layer, true);
+ Layer = null;
+ };
+
//鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
layer_100600_jichang = new mars3d.layer.WmsLayer({
- // id : 10,
+ id:100600,
pid: 1006,
- name: "鏈哄満",
+ name:mars3d.global_variables.layer100600_conifg.name,
type: "wms",
- url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
- layers: "konglu_58:vis_region_100600_hour",
+ url: mars3d.global_variables.geoserver_url_predix+"geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100600_"+mars3d.global_variables.queryDataType,
crs: "EPSG:4326",
parameters: {
+ "styles": "polygon_region_"+mars3d.global_variables.layer1005_conifg.selectedstyle,
"transparent": "true",
"format": "image/png",
- "sld": "http://127.0.0.1:8080/geoserver/styles/polygon_region_co.sld"
+ "viewparams": "userid:" + mars3d.global_variables.userid + ";datatime:" + mars3d.global_variables.queryDataTStart
+
},
- center: { "lat": 30.756467, "lng": 121.614552, "alt": 73242, "heading": 360, "pitch": -56 },
+ // center: { "lat": 30.756467, "lng": 121.614552, "alt": 73242, "heading": 360, "pitch": -56 },
getFeatureInfoParameters: {
feature_count: 10
},
@@ -339,10 +423,16 @@
}),
},
popup: "all",
- show: false,
- selectedMapStyleOptions: 'pm25',
- hasMapStyleOptions: ['pm25', 'pm10', 'no', 'no2', 'nox', 'co'],
- flyTo: true
+ show: mars3d.global_variables.layer100600_conifg.show,
+ selectedMapStyleOptions:mars3d.global_variables.layer100600_conifg.selectedstyle,
+ hasMapStyleOptions: mars3d.global_variables.layer100600_conifg.styleoptions,
+ flyTo: false,
+ reloadLayers:function(new_style){
+ console.log(new_style);
+ console.log(mars3d.global_variables.layer100600_conifg.show);
+ mars3d.global_variables.layer100600_conifg.selectedstyle = new_style;
+ addJichangLayer();
+ }
});
//鍗曞嚮浜嬩欢
@@ -356,21 +446,31 @@
function addMatouLayer() {
+ let Layer = map.getLayerById(100601);
+ if (Layer) {
+ mars3d.global_variables.layer1002_conifg.show = Layer.options.show;
+
+ map.removeLayer(Layer, true);
+ Layer = null;
+ };
+
//鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
layer_100601_matou = new mars3d.layer.WmsLayer({
- // id : 10,
+ id:100601,
pid: 1006,
- name: "鐮佸ご",
+ name: mars3d.global_variables.layer100601_conifg.name,
type: "wms",
- url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
- layers: "konglu_58:vis_region_100601_hour",
+ url: mars3d.global_variables.geoserver_url_predix+"geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100601_"+mars3d.global_variables.queryDataType,
crs: "EPSG:4326",
parameters: {
+ "Styles": "polygon_region_"+mars3d.global_variables.layer100601_conifg.selectedstyle,
"transparent": "true",
"format": "image/png",
- "sld": "http://127.0.0.1:8080/geoserver/styles/polygon_region_co.sld"
+ "viewparams": "userid:" + mars3d.global_variables.userid + ";datatime:" + mars3d.global_variables.queryDataTStart
+
},
- center: { "lat": 30.577234, "lng": 121.664644, "alt": 84121, "heading": 360, "pitch": -56 },
+ // center: { "lat": 30.577234, "lng": 121.664644, "alt": 84121, "heading": 360, "pitch": -56 },
getFeatureInfoParameters: {
feature_count: 10
},
@@ -386,10 +486,16 @@
}),
},
popup: "all",
- show: false,
- selectedMapStyleOptions: 'pm25',
- hasMapStyleOptions: ['pm25', 'pm10', 'no', 'no2', 'nox', 'co'],
- flyTo: true
+ show: mars3d.global_variables.layer100601_conifg.show,
+ selectedMapStyleOptions: mars3d.global_variables.layer100601_conifg.selectedstyle,
+ hasMapStyleOptions: mars3d.global_variables.layer100601_conifg.styleoptions,
+ flyTo: false,
+ reloadLayers:function(new_style){
+ console.log(new_style);
+ console.log(mars3d.global_variables.layer100601_conifg.show);
+ mars3d.global_variables.layer100601_conifg.selectedstyle = new_style;
+ addMatouLayer();
+ }
});
//鍗曞嚮浜嬩欢
@@ -403,21 +509,31 @@
function addHuanxianLayer() {
+ let Layer = map.getLayerById(100602);
+ if (Layer) {
+ mars3d.global_variables.layer1002_conifg.show = Layer.options.show;
+
+ map.removeLayer(Layer, true);
+ Layer = null;
+ };
+
//鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
layer_100602_huanxian = new mars3d.layer.WmsLayer({
- // id : 10,
+ id:100602,
pid: 1006,
- name: "鐜嚎",
+ name: mars3d.global_variables.layer100602_conifg.name,
type: "wms",
- url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
- layers: "konglu_58:vis_region_100602_hour",
+ url: mars3d.global_variables.geoserver_url_predix+"geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100602_"+mars3d.global_variables.queryDataType,
crs: "EPSG:4326",
parameters: {
+ "Styles": "polygon_region_"+mars3d.global_variables.layer100602_conifg.selectedstyle,
"transparent": "true",
"format": "image/png",
- "sld": "http://127.0.0.1:8080/geoserver/styles/polygon_region_co.sld"
+ "viewparams": "userid:" + mars3d.global_variables.userid + ";datatime:" + mars3d.global_variables.queryDataTStart
+
},
- center: { "lat": 30.687288, "lng": 121.623785, "alt": 88144, "heading": 360, "pitch": -56 },
+ // center: { "lat": 30.687288, "lng": 121.623785, "alt": 88144, "heading": 360, "pitch": -56 },
getFeatureInfoParameters: {
feature_count: 10
},
@@ -433,10 +549,16 @@
}),
},
popup: "all",
- show: false,
- selectedMapStyleOptions: 'pm25',
- hasMapStyleOptions: ['pm25', 'pm10', 'no', 'no2', 'nox', 'co'],
- flyTo: true
+ show: mars3d.global_variables.layer100602_conifg.show,
+ selectedMapStyleOptions: mars3d.global_variables.layer100602_conifg.selectedstyle,
+ hasMapStyleOptions:mars3d.global_variables.layer100602_conifg.styleoptions,
+ flyTo: false,
+ reloadLayers:function(new_style){
+ console.log(new_style);
+ console.log(mars3d.global_variables.layer100602_conifg.show);
+ mars3d.global_variables.layer100602_conifg.selectedstyle = new_style;
+ addHuanxianLayer();
+ }
});
//鍗曞嚮浜嬩欢
@@ -451,21 +573,31 @@
function addYuanyuLayer() {
+ let Layer = map.getLayerById(100603);
+ if (Layer) {
+ mars3d.global_variables.layer1002_conifg.show = Layer.options.show;
+
+ map.removeLayer(Layer, true);
+ Layer = null;
+ };
+
//鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
layer_100603_yuanqu = new mars3d.layer.WmsLayer({
- // id : 10,
+ id:100603,
pid: 1006,
- name: "宸ヤ笟鍥尯",
+ name: mars3d.global_variables.layer100603_conifg.name,
type: "wms",
- url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
- layers: "konglu_58:vis_region_100603_hour",
+ url: mars3d.global_variables.geoserver_url_predix+"geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100603_"+mars3d.global_variables.queryDataType,
crs: "EPSG:4326",
parameters: {
+ "styles":"polygon_region_"+mars3d.global_variables.layer100603_conifg.selectedstyle,
"transparent": "true",
"format": "image/png",
- "sld": "http://127.0.0.1:8080/geoserver/styles/polygon_region_co.sld"
+ "viewparams": "userid:" + mars3d.global_variables.userid + ";datatime:" + mars3d.global_variables.queryDataTStart
+
},
- center: { "lat": 30.393398, "lng": 121.534777, "alt": 91038, "heading": 360, "pitch": -56 },
+ // center: { "lat": 30.393398, "lng": 121.534777, "alt": 91038, "heading": 360, "pitch": -56 },
getFeatureInfoParameters: {
feature_count: 10
},
@@ -481,10 +613,16 @@
}),
},
popup: "all",
- show: false,
- selectedMapStyleOptions: 'pm25',
- hasMapStyleOptions: ['pm25', 'pm10', 'no', 'no2', 'nox', 'co'],
- flyTo: true
+ show: mars3d.global_variables.layer100603_conifg.show,
+ selectedMapStyleOptions: mars3d.global_variables.layer100603_conifg.selectedstyle,
+ hasMapStyleOptions: mars3d.global_variables.layer100603_conifg.styleoptions,
+ flyTo: false,
+ reloadLayers:function(new_style){
+ console.log(new_style);
+ console.log(mars3d.global_variables.layer100603_conifg.show);
+ mars3d.global_variables.layer100603_conifg.selectedstyle = new_style;
+ addYuanyuLayer();
+ }
});
//鍗曞嚮浜嬩欢
@@ -498,21 +636,31 @@
function addJinboLayer() {
+ let Layer = map.getLayerById(100604);
+ if (Layer) {
+ mars3d.global_variables.layer1002_conifg.show = Layer.options.show;
+
+ map.removeLayer(Layer, true);
+ Layer = null;
+ };
+
//鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
layer_100604_jinbo = new mars3d.layer.WmsLayer({
- // id : 10,
+ id:100604,
pid: 1006,
- name: "杩涘崥浼�",
+ name: mars3d.global_variables.layer100604_conifg.name,
type: "wms",
- url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
- layers: "konglu_58:vis_region_100604_hour",
+ url: mars3d.global_variables.geoserver_url_predix+"geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100604_"+mars3d.global_variables.queryDataType,
crs: "EPSG:4326",
parameters: {
+ "styles":"polygon_region_"+mars3d.global_variables.layer100604_conifg.selectedstyle,
"transparent": "true",
"format": "image/png",
- "sld": "http://127.0.0.1:8080/geoserver/styles/polygon_region_co.sld"
+ "viewparams": "userid:" + mars3d.global_variables.userid + ";datatime:" + mars3d.global_variables.queryDataTStart
+
},
- center: { "lat": 30.839605, "lng": 121.372945, "alt": 52000, "heading": 360, "pitch": -56 },
+ // center: { "lat": 30.839605, "lng": 121.372945, "alt": 52000, "heading": 360, "pitch": -56 },
getFeatureInfoParameters: {
feature_count: 10
},
@@ -528,10 +676,16 @@
}),
},
popup: "all",
- show: false,
- selectedMapStyleOptions: 'pm25',
- hasMapStyleOptions: ['pm25', 'pm10', 'no', 'no2', 'nox', 'co'],
- flyTo: true
+ show: mars3d.global_variables.layer100604_conifg.show,
+ selectedMapStyleOptions:mars3d.global_variables.layer100604_conifg.selectedstyle,
+ hasMapStyleOptions:mars3d.global_variables.layer100604_conifg.styleoptions,
+ flyTo: false,
+ reloadLayers:function(new_style){
+ console.log(new_style);
+ console.log(mars3d.global_variables.layer100604_conifg.show);
+ mars3d.global_variables.layer100604_conifg.selectedstyle = new_style;
+ addJinboLayer();
+ }
});
//鍗曞嚮浜嬩欢
@@ -545,21 +699,31 @@
function addBianjieLayer() {
+ let Layer = map.getLayerById(100605);
+ if (Layer) {
+ mars3d.global_variables.layer1002_conifg.show = Layer.options.show;
+
+ map.removeLayer(Layer, true);
+ Layer = null;
+ };
+
//鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
layer_100605_bianjie = new mars3d.layer.WmsLayer({
- // id : 10,
+ id:100605,
pid: 1006,
- name: "杈圭晫",
+ name: mars3d.global_variables.layer100605_conifg.name,
type: "wms",
- url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
- layers: "konglu_58:vis_region_100605_hour",
+ url: mars3d.global_variables.geoserver_url_predix+"geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100605_"+mars3d.global_variables.queryDataType,
crs: "EPSG:4326",
parameters: {
+ "styles":"polygon_region_"+mars3d.global_variables.layer100605_conifg.selectedstyle,
"transparent": "true",
"format": "image/png",
- "sld": "http://127.0.0.1:8080/geoserver/styles/polygon_region_co.sld"
+ "viewparams": "userid:" + mars3d.global_variables.userid + ";datatime:" + mars3d.global_variables.queryDataTStart
+
},
- center: { "lat": 30.880665, "lng": 121.305298, "alt": 69363, "heading": 360, "pitch": -56 },
+ // center: { "lat": 30.880665, "lng": 121.305298, "alt": 69363, "heading": 360, "pitch": -56 },
getFeatureInfoParameters: {
feature_count: 10
},
@@ -575,10 +739,16 @@
}),
},
popup: "all",
- show: false,
- selectedMapStyleOptions: 'pm25',
- hasMapStyleOptions: ['pm25', 'pm10', 'no', 'no2', 'nox', 'co'],
- flyTo: true
+ show: mars3d.global_variables.layer100605_conifg.show,
+ selectedMapStyleOptions: mars3d.global_variables.layer100605_conifg.selectedstyle,
+ hasMapStyleOptions: mars3d.global_variables.layer100605_conifg.styleoptions,
+ flyTo: false,
+ reloadLayers:function(new_style){
+ console.log(new_style);
+ console.log(mars3d.global_variables.layer100605_conifg.show);
+ mars3d.global_variables.layer100605_conifg.selectedstyle = new_style;
+ addBianjieLayer();
+ }
});
//鍗曞嚮浜嬩欢
@@ -592,21 +762,31 @@
function addQuanLayer() {
+ let Layer = map.getLayerById(100607);
+ if (Layer) {
+ mars3d.global_variables.layer1002_conifg.show = Layer.options.show;
+
+ map.removeLayer(Layer, true);
+ Layer = null;
+ };
+
//鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
layer_100607_quan = new mars3d.layer.WmsLayer({
- // id : 10,
+ id:100607,
pid: 1006,
- name: "瀹濆北鍦�",
+ name: mars3d.global_variables.layer100607_conifg.name,
type: "wms",
- url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
- layers: "konglu_58:vis_region_100607_hour",
+ url:mars3d.global_variables.geoserver_url_predix +"geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100607_"+mars3d.global_variables.queryDataType,
crs: "EPSG:4326",
parameters: {
+ "styles":"polygon_region_"+mars3d.global_variables.layer100607_conifg.selectedstyle,
"transparent": "true",
"format": "image/png",
- "sld": "http://127.0.0.1:8080/geoserver/styles/polygon_region_co.sld"
+ "viewparams": "userid:" + mars3d.global_variables.userid + ";datatime:" + mars3d.global_variables.queryDataTStart
+
},
- center: { "lat": 30.736361, "lng": 121.566128, "alt": 83811, "heading": 360, "pitch": -56 },
+ // center: { "lat": 30.736361, "lng": 121.566128, "alt": 83811, "heading": 360, "pitch": -56 },
getFeatureInfoParameters: {
feature_count: 10
},
@@ -622,10 +802,16 @@
}),
},
popup: "all",
- show: false,
- selectedMapStyleOptions: 'pm25',
- hasMapStyleOptions: ['pm25', 'pm10', 'no', 'no2', 'nox', 'co'],
- flyTo: true
+ show: mars3d.global_variables.layer100607_conifg.show,
+ selectedMapStyleOptions: mars3d.global_variables.layer100607_conifg.selectedstyle,
+ hasMapStyleOptions: mars3d.global_variables.layer100607_conifg.styleoptions,
+ flyTo: false,
+ reloadLayers:function(new_style){
+ console.log(new_style);
+ console.log(mars3d.global_variables.layer100607_conifg.show);
+ mars3d.global_variables.layer100607_conifg.selectedstyle = new_style;
+ addQuanLayer();
+ }
});
//鍗曞嚮浜嬩欢
@@ -640,22 +826,31 @@
function addXinzhenquLayer() {
+ let Layer = map.getLayerById(100610);
+ if (Layer) {
+ mars3d.global_variables.layer1002_conifg.show = Layer.options.show;
+
+ map.removeLayer(Layer, true);
+ Layer = null;
+ };
+
//鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
layer_100610_qu = new mars3d.layer.WmsLayer({
- // id : 10,
+ id:100610,
pid: 1006,
- name: "琛屾斂鍖�",
+ name: mars3d.global_variables.layer100610_conifg.name,
type: "wms",
- url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
- layers: "konglu_58:vis_region_100610_hour",
+ url: mars3d.global_variables.geoserver_url_predix+"geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100610_"+mars3d.global_variables.queryDataType,
crs: "EPSG:4326",
parameters: {
- "Stayle": "polyline_road_pm25",
+ "styles": "polygon_region_"+ mars3d.global_variables.layer100610_conifg.selectedstyle,
"transparent": "true",
"format": "image/png",
- "sld": "http://127.0.0.1:8080/geoserver/styles/polygon_region_pm25.sld"
+ "viewparams": "userid:" + mars3d.global_variables.userid + ";datatime:" + mars3d.global_variables.queryDataTStart
+
},
- center: { "lat": 30.594533, "lng": 121.581681, "alt": 93405, "heading": 359, "pitch": -61 },
+ // center: { "lat": 30.594533, "lng": 121.581681, "alt": 93405, "heading": 359, "pitch": -61 },
getFeatureInfoParameters: {
feature_count: 10
},
@@ -671,10 +866,16 @@
}),
},
popup: "all",
- show: false,
- selectedMapStyleOptions: 'pm25',
- hasMapStyleOptions: ['pm25', 'pm10', 'no', 'no2', 'nox', 'co'],
- flyTo: true
+ show: mars3d.global_variables.layer100610_conifg.show,
+ selectedMapStyleOptions: mars3d.global_variables.layer100610_conifg.selectedstyle,
+ hasMapStyleOptions:mars3d.global_variables.layer100610_conifg.styleoptions,
+ flyTo: false,
+ reloadLayers:function(new_style){
+ console.log(new_style);
+ console.log(mars3d.global_variables.layer100610_conifg.show);
+ mars3d.global_variables.layer100610_conifg.selectedstyle = new_style;
+ addXinzhenquLayer();
+ }
});
//鍗曞嚮浜嬩欢
@@ -689,27 +890,30 @@
function addJiedaoLayer() {
- let tmpLyaer = map.getLayerById(100611);
- if (tmpLyaer) {
- map.removeLayer(tmpLyaer);
- }
+ let Layer = map.getLayerById(100611);
+ if (Layer) {
+ mars3d.global_variables.layer1002_conifg.show = Layer.options.show;
+
+ map.removeLayer(Layer, true);
+ Layer = null;
+ };
//鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
layer_100611_jiedao = new mars3d.layer.WmsLayer({
id: 100611,
pid: 1006,
- name: mars3d.globel_variables.layer100600_conifg.name,
+ name: mars3d.global_variables.layer100611_conifg.name,
type: "wms",
- url: mars3d.globel_variables.geoserver_url_predix + "geoserver/konglu_58/wms",
- layers: "konglu_58:vis_region_100600_" + mars3d.globel_variables.queryDataType,
+ url: mars3d.global_variables.geoserver_url_predix + "geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100611_" + mars3d.global_variables.queryDataType,
crs: "EPSG:4326",
parameters: {
- "styles": "polygon_region_" + mars3d.globel_variables.layer100600_conifg.selectedstyle,
+ "Styles": "polygon_region_" + mars3d.global_variables.layer100611_conifg.selectedstyle,
"transparent": "true",
"format": "image/png",
- "viewparams": "userid:" + mars3d.globel_variables.userid + ";datatime:" + mars3d.globel_variables.queryDataTStart
+ "viewparams": "userid:" + mars3d.global_variables.userid + ";datatime:" + mars3d.global_variables.queryDataTStart
},
- center: { "lat": 30.466245, "lng": 121.562803, "alt": 107679, "heading": 356, "pitch": -58 },
+ // center: { "lat": 30.466245, "lng": 121.562803, "alt": 107679, "heading": 356, "pitch": -58 },
getFeatureInfoParameters: {
feature_count: 10
},
@@ -725,18 +929,20 @@
}),
},
popup: "all",
- show: true,
- selectedMapStyleOptions: mars3d.globel_variables.layer100600_conifg.selectedstyle,
- hasMapStyleOptions: mars3d.globel_variables.layer100600_conifg.styleoptions,
+ show: mars3d.global_variables.layer100611_conifg.show,
+ selectedMapStyleOptions: mars3d.global_variables.layer100611_conifg.selectedstyle,
+ hasMapStyleOptions: mars3d.global_variables.layer100611_conifg.styleoptions,
flyTo: false,
reloadLayers:function(new_style){
console.log(new_style);
- mars3d.globel_variables.layer100600_conifg.selectedstyle = new_style;
-
+ console.log(mars3d.global_variables.layer100611_conifg.show);
+ mars3d.global_variables.layer100611_conifg.selectedstyle = new_style;
addJiedaoLayer();
}
});
+
+ console.log(layer_100611_jiedao.show);
//鍗曞嚮浜嬩欢
layer_100611_jiedao.on(mars3d.EventType.click, function (event) {
@@ -777,22 +983,38 @@
function addGrid5Layers() {
+ let Layer = map.getLayerById(5000);
+ if (Layer) {
+ mars3d.global_variables.layer1002_conifg.show = Layer.options.show;
+
+ map.removeLayer(Layer, true);
+ Layer = null;
+ };
+
layer_grid_5000 = new mars3d.layer.WmsLayer({
+ id:5000,
pid: 99,
- name: "缃戞牸鍥惧眰5000",
+ name: mars3d.global_variables.layer5000_conifg.name,
type: "wms",
- url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
- layers: "konglu_58:vis_grid5000_hour",
+ url: mars3d.global_variables.geoserver_url_predix+"geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_grid5000_"+mars3d.global_variables.queryDataType,
crs: "EPSG:4326",
parameters: {
- "Stayle": "vis_grid100_1000_5000_co",
+ "styles":"vis_grid100_1000_5000_"+mars3d.global_variables.layer5000_conifg.selectedstyle,
"transparent": "true",
"format": "image/png",
- "sld": "http://127.0.0.1:8080/geoserver/styles/vis_grid100_1000_5000_co.sld"
+ "viewparams": "datatime:" + mars3d.global_variables.queryDataTStart
+
},
- show: false,
- selectedMapStyleOptions: 'pm25',
- hasMapStyleOptions: ['pm25', 'pm10', 'no', 'no2', 'nox', 'co'],
+ show: mars3d.global_variables.layer5000_conifg.show,
+ selectedMapStyleOptions: mars3d.global_variables.layer5000_conifg.selectedstyle,
+ hasMapStyleOptions: mars3d.global_variables.layer5000_conifg.styleoptions,
+ reloadLayers:function(new_style){
+ console.log(new_style);
+ console.log(mars3d.global_variables.layer5000_conifg.show);
+ mars3d.global_variables.layer5000_conifg.selectedstyle = new_style;
+ addGrid5Layers();
+ }
});
map.addLayer(layer_grid_5000);
@@ -821,22 +1043,39 @@
function addGrid1Layers() {
+ let Layer = map.getLayerById(1000);
+ if (Layer) {
+ mars3d.global_variables.layer1002_conifg.show = Layer.options.show;
+
+ map.removeLayer(Layer, true);
+ Layer = null;
+ };
+
layer_grid_1000 = new mars3d.layer.WmsLayer({
+ id:1000,
pid: 99,
- name: "缃戞牸鍥惧眰1000",
+ name: mars3d.global_variables.layer1000_conifg.name,
type: "wms",
- url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
- layers: "konglu_58:vis_grid1000_hour",
+ url:mars3d.global_variables.geoserver_url_predix +"geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_grid1000_"+mars3d.global_variables.queryDataType,
crs: "EPSG:4326",
parameters: {
- "Stayle": "vis_grid100_1000_5000_co",
+ "styles":"vis_grid100_1000_5000_"+mars3d.global_variables.layer1000_conifg.selectedstyle,
"transparent": "true",
"format": "image/png",
- "sld": "http://127.0.0.1:8080/geoserver/styles/vis_grid100_1000_5000_co.sld"
+ "viewparams": "datatime:" + mars3d.global_variables.queryDataTStart
+
+
},
- show: false,
- selectedMapStyleOptions: 'pm25',
- hasMapStyleOptions: ['pm25', 'pm10', 'no', 'no2', 'nox', 'co'],
+ show: mars3d.global_variables.layer1000_conifg.show,
+ selectedMapStyleOptions: mars3d.global_variables.layer1000_conifg.selectedstyle,
+ hasMapStyleOptions: mars3d.global_variables.layer1000_conifg.styleoptions,
+ reloadLayers:function(new_style){
+ console.log(new_style);
+ console.log(mars3d.global_variables.layer1000_conifg.show);
+ mars3d.global_variables.layer1000_conifg.selectedstyle = new_style;
+ addGrid1Layers();
+ }
});
map.addLayer(layer_grid_1000);
@@ -857,8 +1096,6 @@
}
-
-
function addFunctionalLayers() {
--
Gitblit v1.9.1