From 233f799d7659ad94a88632db79f54069074bf315 Mon Sep 17 00:00:00 2001
From: wangzhibo <wangzhibo@shsening.com>
Date: 星期五, 17 九月 2021 08:46:19 +0800
Subject: [PATCH] Merge branch 'master' of http://www.shsening.com:10000/r/template/shanghai
---
js/function.js | 737 ++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 656 insertions(+), 81 deletions(-)
diff --git a/js/function.js b/js/function.js
index d6600b0..534dd82 100644
--- a/js/function.js
+++ b/js/function.js
@@ -16,8 +16,19 @@
var layer_1002_weizhan;
var layer_1003_jiance;
var layer_1004_taxi;
-var layer_1005_region;
-var layer_1006_roadsection;
+var layer_1005_roadsection;
+
+var layer_1006_region;
+var layer_100600_jichang;
+var layer_100601_matou;
+var layer_100602_huanxian;
+var layer_100603_yuanqu;
+var layer_100604_jinbo;
+var layer_100605_bianjie;
+var layer_100607_quan;
+var layer_100610_qu;
+var layer_100611_jiedao;
+
var layer_wind;
var layer_grid_100;
@@ -59,7 +70,6 @@
layer_1001_guokong = new mars3d.layer.DivLayer({
name: '鍥芥帶鐐�',
pid: 99, //鍥惧眰绠$悊 涓娇鐢紝鐖惰妭鐐筰d
- show: false,
selectedMapStyleOptions:'pm25',
hasMapStyleOptions:['pm25','pm10','no','no2','nox','co']
});
@@ -80,85 +90,122 @@
layer_1001_guokong.bindPopup(function (event) {
let item = event.graphic?.attr;
var html =
- "楂樻牎鍚嶇О锛�" +
- item["楂樻牎鍚嶇О"] +
- "<br />鎵�灞炲湴鍖猴細" +
- item["鍦板尯"] +
- "<br />涓荤閮ㄩ棬锛�" +
- item["涓荤閮ㄩ棬"] +
- "<br />鍔炲灞傛锛�" +
- item["鍔炲灞傛"] +
- "<br />鐜嬬墝涓撲笟锛�" +
- item["鐜嬬墝涓撲笟"] +
- "<br /><br /><p><a href='#' onclick='javascript:showDetail(1001,\"" + item["楂樻牎鍚嶇О"] + "\")' >璇︾粏淇℃伅</a></p>";
- return html;
+ "绔欑偣鍚嶇О锛�" +
+ item["SiteName"] +
+ "<br />鍒嗗尯锛�" +
+ item["RegionName"] +
+ "<br />AQI:" +
+ item["AQI"] +
+ "<br />PM25:" +
+ item["PM25"] + "ug/m3"+
+ "<br />SO2:" +
+ item["SO2"] + "ug/m3"+
+ "<br />O3:" +
+ item["O31"] + "ug/m3"+
+ "<br /><br /><p><a href='#' onclick='javascript:showDetail(1001,\""+item["楂樻牎鍚嶇О"]+"\")' >璇︾粏淇℃伅</a></p>";
+ return html;
});
+
// add 鍥芥帶鐐�
- //鏄剧ず楂樻牎鐐�
- $.getJSON("//data.mars3d.cn/file/apidemo/gaoxiao.json", (result) => {
- //$.getJSON("http://58.246.27.194:7012/dataapi/Bdata?bid=get_guokong_hour&datatime="+datatime, (result) => {
- var pointColorArr = ["#f33349", "#f79a2c", "#f2fa19", "#95e40c", "#1ffee6"];
- for (var i = 0, len = result.length; i < len; i++) {
- var item = result[i];
- var jwd = item["缁忕含搴�"].split(",");
- if (jwd.length !== 2) {
- continue;
- }
-
- var jd = Number(jwd[0]);
- var wd = Number(jwd[1]);
+ $.getJSON("http://58.246.27.194:7012/dataapi/Bdata?bid=get_1001_list_hour&datatime=2021-09-06%2012:00:00&qindex=pm25", (result) => {
+ var pointColorArr = ["#f33349","#fff000","#33347f"];
+ for (var i = 0, len = result.data.result.length; i < len; i++) {
+ var item = result.data.result[i];
+ var jd = result.data.result[i].Longitude;
+ var wd = result.data.result[i].Latitude;
var clr = pointColorArr[i % pointColorArr.length];
- var graphic = new mars3d.graphic.DivGraphic({
+ var graphic = new mars3d.graphic.DivLightPoint({
position: Cesium.Cartesian3.fromDegrees(jd, wd),
style: {
- html: '<div class="mars3d-animation-point" style="color:' + clr + ';"><p></p></div>',
+ color: clr,
+ heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
+ // html: '<div class="mars3d-animation-point" style="color:' + clr + ';"><p></p></div>',
// html: '<div><p><img src="img/marker/mark1.png"></p></div>',
- // scaleByDistance_far: 1100, // 鐭崐杞� 鍗婂緞
- // scaleByDistance_near: 2000, //闀垮崐杞� 鍗婂緞
- // height: 200,
- // material: mars3d.MaterialUtil.createMaterialProperty(mars3d.MaterialType.CircleWave, {
- // color: "#ffff00",
- // count: 3,
- // speed: 20,
- // }),
- // highlight: {
- // type: "click",
- // diffHeight: 600,
- // material: mars3d.MaterialUtil.createMaterialProperty(mars3d.MaterialType.CircleWave, {
- // color: "#ffff00",
- // count: 3,
- // speed: 20,
- // }),
- // },
+ highlight: {
+ type: "divLightPoint",
+ diffHeight: 600,
+ material: mars3d.MaterialUtil.createMaterialProperty(mars3d.MaterialType.CircleWave, {
+ color: "#ffff00",
+ count: 3,
+ speed: 20,
+ }),
+ },
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 200000), //鎸夎璺濊窛绂绘樉绀�
},
-
+ show: true,
attr: item,
});
layer_1001_guokong.addGraphic(graphic);
}
});
-
-
}
-function addRoadLayer() {
+
+function addWeizhanLayer() {
//鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
- layer_1006_roadsection = new mars3d.layer.WmsLayer({
+ layer_1002_weizhan = new mars3d.layer.WmsLayer({
pid: 99,
- name: "涓婃捣甯傞亾璺�",
+ name: "寰珯",
type: "wms",
url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
- layers: "konglu_58:v_test",
+ layers: "konglu_58:vis_weizhan_hour",
crs: "EPSG:4326",
parameters: {
+ "Styles":"point_weizhan_pm25",
"transparent": "true",
"format": "image/png",
- "sld": "http://127.0.0.1:8080/geoserver/styles/pm10_ten.sld"
+ "sld": "http://127.0.0.1:8080/geoserver/styles/point_weizhan_pm25.sld"
},
- center: { "lat": 31.162801, "lng": 121.543277, "alt": 50000, "heading": 359.2, "pitch": -39.5 },
+ center: {"lat":30.429987,"lng":121.590473,"alt":58635,"heading":359,"pitch":-40},
+ getFeatureInfoParameters: {
+ feature_count: 10
+ },
+ //鍗曞嚮楂樹寒鍙婂叾鏍峰紡
+ highlight: {
+ type: "click",
+ diffHeight: 300,
+ material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, {
+ image: "img/textures/fence.png",
+ color: "#ffff00",
+ speed: 10, //閫熷害锛屽缓璁彇鍊艰寖鍥�1-100
+ axisY: true,
+ }),
+ },
+ popup: "all",
+ show: false,
+ selectedMapStyleOptions:'pm25',
+ hasMapStyleOptions:['pm25','pm10','no','no2','nox','co'],
+ flyTo: true
+ });
+
+ //鍗曞嚮浜嬩欢
+ layer_1002_weizhan.on(mars3d.EventType.click, function (event) {
+ console.log("鍗曞嚮浜嗙煝閲忔暟鎹紝鍏�" + event.features.length + "鏉�", event);
+ });
+
+ map.addLayer(layer_1002_weizhan);
+
+}
+
+function addJianceLayer() {
+
+ //鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
+ layer_1003_jiance = new mars3d.layer.WmsLayer({
+ pid: 99,
+ name: "鐩戞祴鐐�",
+ type: "wms",
+ url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_weizhan_hour",
+ crs: "EPSG:4326",
+ parameters: {
+ "Styles":"point_weizhan_pm25",
+ "transparent": "true",
+ "format": "image/png",
+ "sld": "http://127.0.0.1:8080/geoserver/styles/point_weizhan_pm25.sld"
+ },
+ center: {"lat":30.429987,"lng":121.590473,"alt":58635,"heading":359,"pitch":-40},
getFeatureInfoParameters: {
feature_count: 10
},
@@ -175,18 +222,501 @@
},
popup: "all",
show: false,
+ selectedMapStyleOptions:'pm25',
+ hasMapStyleOptions:['pm25','pm10','no','no2','nox','co'],
flyTo: true
});
//鍗曞嚮浜嬩欢
- layer_1006_roadsection.on(mars3d.EventType.click, function (event) {
+ layer_1003_jiance.on(mars3d.EventType.click, function (event) {
console.log("鍗曞嚮浜嗙煝閲忔暟鎹紝鍏�" + event.features.length + "鏉�", event);
});
- map.addLayer(layer_1006_roadsection);
+ map.addLayer(layer_1003_jiance);
}
+
+function addRoadLayer() {
+
+ //鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
+ layer_1005_roadsection = new mars3d.layer.WmsLayer({
+ pid: 99,
+ name: "涓婃捣甯傞亾璺�",
+ type: "wms",
+ url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_roadsection_hour",
+ crs: "EPSG:4326",
+ parameters: {
+ "Stayle":"polyline_road_pm25",
+ "transparent": "true",
+ "format": "image/png",
+ "sld": "http://127.0.0.1:8080/geoserver/styles/polyline_road_pm25.sld"
+ },
+ center:{"lat":30.487351,"lng":121.613269,"alt":54033,"heading":359,"pitch":-40},
+ getFeatureInfoParameters: {
+ feature_count: 10
+ },
+ //鍗曞嚮楂樹寒鍙婂叾鏍峰紡
+ highlight: {
+ type: "wallP",
+ diffHeight: 300,
+ material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, {
+ image: "img/textures/fence.png",
+ color: "#ffff00",
+ speed: 10, //閫熷害锛屽缓璁彇鍊艰寖鍥�1-100
+ axisY: true,
+ }),
+ },
+ popup: "all",
+ show: false,
+ selectedMapStyleOptions:'pm25',
+ hasMapStyleOptions:['pm25','pm10','no','no2','nox','co'],
+ flyTo: true
+ });
+
+ //鍗曞嚮浜嬩欢
+ layer_1005_roadsection.on(mars3d.EventType.click, function (event) {
+ console.log("鍗曞嚮浜嗙煝閲忔暟鎹紝鍏�" + event.features.length + "鏉�", event);
+ });
+
+ map.addLayer(layer_1005_roadsection);
+
+}
+
+
+
+function addJichangLayer() {
+
+ //鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
+ layer_100600_jichang = new mars3d.layer.WmsLayer({
+ // id : 10,
+ pid: 1006,
+ name: "鏈哄満",
+ type: "wms",
+ url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100600_hour",
+ crs: "EPSG:4326",
+ parameters: {
+ "transparent": "true",
+ "format": "image/png",
+ "sld": "http://127.0.0.1:8080/geoserver/styles/polygon_region_co.sld"
+ },
+ center: {"lat":30.756467,"lng":121.614552,"alt":73242,"heading":360,"pitch":-56},
+ getFeatureInfoParameters: {
+ feature_count: 10
+ },
+ //鍗曞嚮楂樹寒鍙婂叾鏍峰紡
+ highlight: {
+ type: "wallP",
+ diffHeight: 300,
+ material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, {
+ image: "img/textures/fence.png",
+ color: "#ffff00",
+ speed: 10, //閫熷害锛屽缓璁彇鍊艰寖鍥�1-100
+ axisY: true,
+ }),
+ },
+ popup: "all",
+ show: false,
+ selectedMapStyleOptions:'pm25',
+ hasMapStyleOptions:['pm25','pm10','no','no2','nox','co'],
+ flyTo: true
+ });
+
+ //鍗曞嚮浜嬩欢
+ layer_100600_jichang.on(mars3d.EventType.click, function (event) {
+ console.log("鍗曞嚮浜嗙煝閲忔暟鎹紝鍏�" + event.features.length + "鏉�", event);
+ });
+
+ map.addLayer(layer_100600_jichang);
+
+}
+
+function addMatouLayer() {
+
+ //鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
+ layer_100601_matou = new mars3d.layer.WmsLayer({
+ // id : 10,
+ pid: 1006,
+ name: "鐮佸ご",
+ type: "wms",
+ url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100601_hour",
+ crs: "EPSG:4326",
+ parameters: {
+ "transparent": "true",
+ "format": "image/png",
+ "sld": "http://127.0.0.1:8080/geoserver/styles/polygon_region_co.sld"
+ },
+ center: {"lat":30.577234,"lng":121.664644,"alt":84121,"heading":360,"pitch":-56},
+ getFeatureInfoParameters: {
+ feature_count: 10
+ },
+ //鍗曞嚮楂樹寒鍙婂叾鏍峰紡
+ highlight: {
+ type: "wallP",
+ diffHeight: 300,
+ material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, {
+ image: "img/textures/fence.png",
+ color: "#ffff00",
+ speed: 10, //閫熷害锛屽缓璁彇鍊艰寖鍥�1-100
+ axisY: true,
+ }),
+ },
+ popup: "all",
+ show: false,
+ selectedMapStyleOptions:'pm25',
+ hasMapStyleOptions:['pm25','pm10','no','no2','nox','co'],
+ flyTo: true
+ });
+
+ //鍗曞嚮浜嬩欢
+ layer_100601_matou.on(mars3d.EventType.click, function (event) {
+ console.log("鍗曞嚮浜嗙煝閲忔暟鎹紝鍏�" + event.features.length + "鏉�", event);
+ });
+
+ map.addLayer(layer_100601_matou);
+
+}
+
+function addHuanxianLayer() {
+
+ //鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
+ layer_100602_huanxian = new mars3d.layer.WmsLayer({
+ // id : 10,
+ pid: 1006,
+ name: "鐜嚎",
+ type: "wms",
+ url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100602_hour",
+ crs: "EPSG:4326",
+ parameters: {
+ "transparent": "true",
+ "format": "image/png",
+ "sld": "http://127.0.0.1:8080/geoserver/styles/polygon_region_co.sld"
+ },
+ center: {"lat":30.687288,"lng":121.623785,"alt":88144,"heading":360,"pitch":-56},
+ getFeatureInfoParameters: {
+ feature_count: 10
+ },
+ //鍗曞嚮楂樹寒鍙婂叾鏍峰紡
+ highlight: {
+ type: "wallP",
+ diffHeight: 300,
+ material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, {
+ image: "img/textures/fence.png",
+ color: "#ffff00",
+ speed: 10, //閫熷害锛屽缓璁彇鍊艰寖鍥�1-100
+ axisY: true,
+ }),
+ },
+ popup: "all",
+ show: false,
+ selectedMapStyleOptions:'pm25',
+ hasMapStyleOptions:['pm25','pm10','no','no2','nox','co'],
+ flyTo: true
+ });
+
+ //鍗曞嚮浜嬩欢
+ layer_100602_huanxian.on(mars3d.EventType.click, function (event) {
+ console.log("鍗曞嚮浜嗙煝閲忔暟鎹紝鍏�" + event.features.length + "鏉�", event);
+ });
+
+ map.addLayer(layer_100602_huanxian);
+
+}
+
+
+function addYuanyuLayer() {
+
+ //鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
+ layer_100603_yuanqu = new mars3d.layer.WmsLayer({
+ // id : 10,
+ pid: 1006,
+ name: "宸ヤ笟鍥尯",
+ type: "wms",
+ url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100603_hour",
+ crs: "EPSG:4326",
+ parameters: {
+ "transparent": "true",
+ "format": "image/png",
+ "sld": "http://127.0.0.1:8080/geoserver/styles/polygon_region_co.sld"
+ },
+ center:{"lat":30.393398,"lng":121.534777,"alt":91038,"heading":360,"pitch":-56},
+ getFeatureInfoParameters: {
+ feature_count: 10
+ },
+ //鍗曞嚮楂樹寒鍙婂叾鏍峰紡
+ highlight: {
+ type: "wallP",
+ diffHeight: 300,
+ material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, {
+ image: "img/textures/fence.png",
+ color: "#ffff00",
+ speed: 10, //閫熷害锛屽缓璁彇鍊艰寖鍥�1-100
+ axisY: true,
+ }),
+ },
+ popup: "all",
+ show: false,
+ selectedMapStyleOptions:'pm25',
+ hasMapStyleOptions:['pm25','pm10','no','no2','nox','co'],
+ flyTo: true
+ });
+
+ //鍗曞嚮浜嬩欢
+ layer_100603_yuanqu.on(mars3d.EventType.click, function (event) {
+ console.log("鍗曞嚮浜嗙煝閲忔暟鎹紝鍏�" + event.features.length + "鏉�", event);
+ });
+
+ map.addLayer(layer_100603_yuanqu);
+
+}
+
+function addJinboLayer() {
+
+ //鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
+ layer_100604_jinbo = new mars3d.layer.WmsLayer({
+ // id : 10,
+ pid: 1006,
+ name: "杩涘崥浼�",
+ type: "wms",
+ url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100604_hour",
+ crs: "EPSG:4326",
+ parameters: {
+ "transparent": "true",
+ "format": "image/png",
+ "sld": "http://127.0.0.1:8080/geoserver/styles/polygon_region_co.sld"
+ },
+ center: {"lat":30.839605,"lng":121.372945,"alt":52000,"heading":360,"pitch":-56},
+ getFeatureInfoParameters: {
+ feature_count: 10
+ },
+ //鍗曞嚮楂樹寒鍙婂叾鏍峰紡
+ highlight: {
+ type: "wallP",
+ diffHeight: 300,
+ material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, {
+ image: "img/textures/fence.png",
+ color: "#ffff00",
+ speed: 10, //閫熷害锛屽缓璁彇鍊艰寖鍥�1-100
+ axisY: true,
+ }),
+ },
+ popup: "all",
+ show: false,
+ selectedMapStyleOptions:'pm25',
+ hasMapStyleOptions:['pm25','pm10','no','no2','nox','co'],
+ flyTo: true
+ });
+
+ //鍗曞嚮浜嬩欢
+ layer_100604_jinbo.on(mars3d.EventType.click, function (event) {
+ console.log("鍗曞嚮浜嗙煝閲忔暟鎹紝鍏�" + event.features.length + "鏉�", event);
+ });
+
+ map.addLayer(layer_100604_jinbo);
+
+}
+
+function addBianjieLayer() {
+
+ //鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
+ layer_100605_bianjie = new mars3d.layer.WmsLayer({
+ // id : 10,
+ pid: 1006,
+ name: "杈圭晫",
+ type: "wms",
+ url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100605_hour",
+ crs: "EPSG:4326",
+ parameters: {
+ "transparent": "true",
+ "format": "image/png",
+ "sld": "http://127.0.0.1:8080/geoserver/styles/polygon_region_co.sld"
+ },
+ center: {"lat":30.880665,"lng":121.305298,"alt":69363,"heading":360,"pitch":-56},
+ getFeatureInfoParameters: {
+ feature_count: 10
+ },
+ //鍗曞嚮楂樹寒鍙婂叾鏍峰紡
+ highlight: {
+ type: "wallP",
+ diffHeight: 300,
+ material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, {
+ image: "img/textures/fence.png",
+ color: "#ffff00",
+ speed: 10, //閫熷害锛屽缓璁彇鍊艰寖鍥�1-100
+ axisY: true,
+ }),
+ },
+ popup: "all",
+ show: false,
+ selectedMapStyleOptions:'pm25',
+ hasMapStyleOptions:['pm25','pm10','no','no2','nox','co'],
+ flyTo: true
+ });
+
+ //鍗曞嚮浜嬩欢
+ layer_100605_bianjie.on(mars3d.EventType.click, function (event) {
+ console.log("鍗曞嚮浜嗙煝閲忔暟鎹紝鍏�" + event.features.length + "鏉�", event);
+ });
+
+ map.addLayer(layer_100605_bianjie);
+
+}
+
+function addQuanLayer() {
+
+ //鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
+ layer_100607_quan = new mars3d.layer.WmsLayer({
+ // id : 10,
+ pid: 1006,
+ name: "瀹濆北鍦�",
+ type: "wms",
+ url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100607_hour",
+ crs: "EPSG:4326",
+ parameters: {
+ "transparent": "true",
+ "format": "image/png",
+ "sld": "http://127.0.0.1:8080/geoserver/styles/polygon_region_co.sld"
+ },
+ center:{"lat":30.736361,"lng":121.566128,"alt":83811,"heading":360,"pitch":-56},
+ getFeatureInfoParameters: {
+ feature_count: 10
+ },
+ //鍗曞嚮楂樹寒鍙婂叾鏍峰紡
+ highlight: {
+ type: "wallP",
+ diffHeight: 300,
+ material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, {
+ image: "img/textures/fence.png",
+ color: "#ffff00",
+ speed: 10, //閫熷害锛屽缓璁彇鍊艰寖鍥�1-100
+ axisY: true,
+ }),
+ },
+ popup: "all",
+ show: false,
+ selectedMapStyleOptions:'pm25',
+ hasMapStyleOptions:['pm25','pm10','no','no2','nox','co'],
+ flyTo: true
+ });
+
+ //鍗曞嚮浜嬩欢
+ layer_100607_quan.on(mars3d.EventType.click, function (event) {
+ console.log("鍗曞嚮浜嗙煝閲忔暟鎹紝鍏�" + event.features.length + "鏉�", event);
+ });
+
+ map.addLayer(layer_100607_quan);
+
+}
+
+
+function addXinzhenquLayer() {
+
+ //鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
+ layer_100610_qu = new mars3d.layer.WmsLayer({
+ // id : 10,
+ pid: 1006,
+ name: "琛屾斂鍖�",
+ type: "wms",
+ url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100610_hour",
+ crs: "EPSG:4326",
+ parameters: {
+ "Stayle":"polyline_road_pm25",
+ "transparent": "true",
+ "format": "image/png",
+ "sld": "http://127.0.0.1:8080/geoserver/styles/polygon_region_pm25.sld"
+ },
+ center:{"lat":30.594533,"lng":121.581681,"alt":93405,"heading":359,"pitch":-61},
+ getFeatureInfoParameters: {
+ feature_count: 10
+ },
+ //鍗曞嚮楂樹寒鍙婂叾鏍峰紡
+ highlight: {
+ type: "wallP",
+ diffHeight: 300,
+ material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, {
+ image: "img/textures/fence.png",
+ color: "#ffff00",
+ speed: 10, //閫熷害锛屽缓璁彇鍊艰寖鍥�1-100
+ axisY: true,
+ }),
+ },
+ popup: "all",
+ show: false,
+ selectedMapStyleOptions:'pm25',
+ hasMapStyleOptions:['pm25','pm10','no','no2','nox','co'],
+ flyTo: true
+ });
+
+ //鍗曞嚮浜嬩欢
+ layer_100610_qu.on(mars3d.EventType.click, function (event) {
+ console.log("鍗曞嚮浜嗙煝閲忔暟鎹紝鍏�" + event.features.length + "鏉�", event);
+ });
+
+ map.addLayer(layer_100610_qu);
+
+}
+
+
+function addJiedaoLayer() {
+
+ //鏂瑰紡2锛氬湪鍒涘缓鍦扮悆鍚庤皟鐢╝ddLayer娣诲姞鍥惧眰(鐩存帴new瀵瑰簲type绫诲瀷鐨勫浘灞傜被)
+ layer_100611_jiedao = new mars3d.layer.WmsLayer({
+ // id : 10,
+ pid: 1006,
+ name: "琛楅亾",
+ type: "wms",
+ url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_region_100611_hour",
+ crs: "EPSG:4326",
+ parameters: {
+ "Stayle":"polyline_road_pm25",
+ "transparent": "true",
+ "format": "image/png",
+ "sld": "http://127.0.0.1:8080/geoserver/styles/polygon_region_pm25.sld"
+ },
+ center: {"lat":30.466245,"lng":121.562803,"alt":107679,"heading":356,"pitch":-58},
+ getFeatureInfoParameters: {
+ feature_count: 10
+ },
+ //鍗曞嚮楂樹寒鍙婂叾鏍峰紡
+ highlight: {
+ type: "wallP",
+ diffHeight: 300,
+ material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, {
+ image: "img/textures/fence.png",
+ color: "#ffff00",
+ speed: 10, //閫熷害锛屽缓璁彇鍊艰寖鍥�1-100
+ axisY: true,
+ }),
+ },
+ popup: "all",
+ show: false,
+ selectedMapStyleOptions:'pm25',
+ hasMapStyleOptions:['pm25','pm10','no','no2','nox','co'],
+ flyTo: true
+ });
+
+ //鍗曞嚮浜嬩欢
+ layer_100611_jiedao.on(mars3d.EventType.click, function (event) {
+ console.log("鍗曞嚮浜嗙煝閲忔暟鎹紝鍏�" + event.features.length + "鏉�", event);
+ });
+
+ map.addLayer(layer_100611_jiedao);
+
+}
+
+
+
+/////////
function addMaskShanghai() {
//geojson 鍚堣偉杈圭晫绾�
@@ -211,25 +741,29 @@
}
-function addGridLayers() {
+function addGrid5Layers() {
layer_grid_5000 = new mars3d.layer.WmsLayer({
pid: 99,
name: "缃戞牸鍥惧眰5000",
type: "wms",
url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
- layers: "konglu_58:vis_grid1000_hour",
+ layers: "konglu_58:vis_grid5000_hour",
crs: "EPSG:4326",
parameters: {
+ "Stayle":"vis_grid100_1000_5000_co",
"transparent": "true",
"format": "image/png",
- "sld": "http://127.0.0.1:8080/geoserver/styles/vis_grid1000_5000_co.sld"
+ "sld": "http://127.0.0.1:8080/geoserver/styles/vis_grid100_1000_5000_co.sld"
},
+ show: false,
+ selectedMapStyleOptions:'pm25',
+ hasMapStyleOptions:['pm25','pm10','no','no2','nox','co'],
});
map.addLayer(layer_grid_5000);
layer_grid_5000.reloadLayers = function (){
- layer_grid_5000.options.layers ="konglu_58:vis_grid1000_day";
+ layer_grid_5000.options.layers ="konglu_58:vis_grid5000_day";
layer_grid_5000.options.parameters.sld ="http://127.0.0.1:8080/geoserver/styles/"+layer_grid_5000.options.selectedMapStyleOptions+".sld";
layer_grid_5000.options.parameters.viewparams="id1:0;id2:10";
console.log(layer_grid_5000);
@@ -241,41 +775,82 @@
console.log("鍗曞嚮浜嗙煝閲忔暟鎹紝鍏�" + event.features.length + "鏉�", event);
});
+ map.addLayer(layer_grid_5000);
}
-function reLoadLayers(){
- console.log(mars3d.globel_variables.queryDataTStart);
- console.log(mars3d.globel_variables.queryDataType);
- console.log('starting to reload layer .');
+
+
+
+
+
+
+
+function addGrid1Layers() {
+
+ layer_grid_1000 = new mars3d.layer.WmsLayer({
+ pid: 99,
+ name: "缃戞牸鍥惧眰1000",
+ type: "wms",
+ url: "http://58.246.27.194:7011/geoserver/konglu_58/wms",
+ layers: "konglu_58:vis_grid1000_hour",
+ crs: "EPSG:4326",
+ parameters: {
+ "Stayle":"vis_grid100_1000_5000_co",
+ "transparent": "true",
+ "format": "image/png",
+ "sld": "http://127.0.0.1:8080/geoserver/styles/vis_grid100_1000_5000_co.sld"
+ },
+ show:false,
+ selectedMapStyleOptions:'pm25',
+ hasMapStyleOptions:['pm25','pm10','no','no2','nox','co'],
+
+ });
+ map.addLayer(layer_grid_1000);
+
+ layer_grid_1000.reloadLayers = function (){
+ layer_grid_1000.options.layers ="konglu_58:vis_grid1000_day";
+ layer_grid_1000.options.parameters.sld ="http://127.0.0.1:8080/geoserver/styles/"+layer_grid_1000.options.selectedMapStyleOptions+".sld";
+ layer_grid_1000.options.parameters.viewparams="id1:0;id2:10";
+ console.log(layer_grid_1000);
+ layer_grid_1000.reload();
+ }
+
+ //鍗曞嚮浜嬩欢
+ layer_grid_1000.on(mars3d.EventType.click, function (event) {
+ console.log("鍗曞嚮浜嗙煝閲忔暟鎹紝鍏�" + event.features.length + "鏉�", event);
+ });
+ map.addLayer(layer_grid_1000);
+
}
-function refreshWidgets(){
- console.log(mars3d.globel_variables.queryDataTStart);
- console.log(mars3d.globel_variables.queryDataType);
- console.log('starting to reload widget if widget has been opened.');
-}
+
function addFunctionalLayers() {
-
-
// add mask
//addMaskShanghai();
-
addTDTAnnoLayer();
// 娣诲姞涓氬姟鍥惧眰
addguokongLayers();
-
+ addWeizhanLayer();
+ addJianceLayer();
addRoadLayer();
-
+ // addRegionLayer();
+ addJichangLayer();
+ addMatouLayer();
+ addHuanxianLayer();
+ addYuanyuLayer();
+ addJinboLayer();
+ addBianjieLayer();
+ addQuanLayer();
+ addXinzhenquLayer();
+ addJiedaoLayer();
+
addWindLayer();
-
- addGridLayers();
-
-
-
+ addGrid5Layers();
+ addGrid1Layers();
}
--
Gitblit v1.9.1