| | |
| | | |
| | | } |
| | | |
| | | function addWMSLayer(item) { |
| | | |
| | | var wmsLyer = new mars3d.layer.WmsLayer({ |
| | | id: item.id, |
| | | pid: item.pid, |
| | | name: item.name, |
| | | type: "wms", |
| | | url: mars3d.global_variables.geoserver_url_predix + "/geoserver/konglu_58/wms", |
| | | layers: "konglu_58:" + item.geoname_prefix + mars3d.global_variables.queryDataType, |
| | | crs: "EPSG:4326", |
| | | parameters: { |
| | | "styles": item.style_prefix + item.style_selected, |
| | | "transparent": "true", |
| | | "format": "image/png", |
| | | "viewparams": "userid:" + mars3d.global_variables.userid + ";datatime:" + mars3d.global_variables.queryDataTStartGeo |
| | | }, |
| | | center: { "lat": 30.487351, "lng": 121.613269, "alt": 54033, "heading": 359, "pitch": -40 }, |
| | | noCenter: true, |
| | | maxLength: 35000, |
| | | 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: item.show, |
| | | geoname_prefix: item.geoname_prefix, |
| | | style_prefix: item.style_prefix, |
| | | style_selected:item.style_selected, |
| | | style_options: item.styleoptions, |
| | | flyTo: false |
| | | }); |
| | | |
| | | //单击事件 |
| | | wmsLyer.on(mars3d.EventType.click, function (event) { |
| | | console.log("单击了矢量数据,共" + event.features.length + "条", event); |
| | | console.log(event.layer.options.style_selected); |
| | | |
| | | |
| | | console.log(event.graphic); |
| | | /* |
| | | event.graphic.style.diffHeight = |
| | | |
| | | diffHeight: 300, |
| | | material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, { |
| | | image: "img/textures/fence.png", |
| | | color: "#ffff00", |
| | | speed: 10, //速度,建议取值范围1-100 |
| | | axisY: true, |
| | | }), |
| | | */ |
| | | }); |
| | | |
| | | map.addLayer(wmsLyer); |
| | | |
| | | } |
| | | |
| | | function reLoadLayers() { |
| | | var layers = map.getLayers({ layers: true }); |
| | |
| | | "use script"; //开发环境建议开启严格模式 |
| | | //系统 功能入口 |
| | | |
| | | |
| | | var allLayer_color_nodata = '#C0C0C0'; |
| | | var guokong_color_list = ['#0EE839', '#FEFE23', '#FD9D00', '#F70F0D', '#8A0B73', '#88041E']; |
| | | var guokong_color_nodata = '#C0C0C0'; |
| | | var guokong_qindex_color_list = { 'pm25': [35, 75, 115, 150, 250], 'pm10': [50, 150, 250, 350, 420], 'no2': [100, 200, 700, 1200, 2340], 'co': [5, 10, 35, 60, 90] }; |
| | | var guokong_data_list; |
| | | |
| | | |
| | | function addWMSLayer(item) { |
| | | |
| | | var wmsLyer = new mars3d.layer.WmsLayer({ |
| | | id: item.id, |
| | | pid: item.pid, |
| | | name: item.name, |
| | | type: "wms", |
| | | url: mars3d.global_variables.geoserver_url_predix + "/geoserver/konglu_58/wms", |
| | | layers: "konglu_58:" + item.geoname_prefix + mars3d.global_variables.queryDataType, |
| | | crs: "EPSG:4326", |
| | | parameters: { |
| | | "styles": item.style_prefix + item.style_selected, |
| | | "transparent": "true", |
| | | "format": "image/png", |
| | | "viewparams": "userid:" + mars3d.global_variables.userid + ";datatime:" + mars3d.global_variables.queryDataTStartGeo |
| | | }, |
| | | center: { "lat": 30.487351, "lng": 121.613269, "alt": 54033, "heading": 359, "pitch": -40 }, |
| | | noCenter: true, |
| | | maxLength: 35000, |
| | | 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: item.show, |
| | | geoname_prefix: item.geoname_prefix, |
| | | style_prefix: item.style_prefix, |
| | | style_selected:item.style_selected, |
| | | style_options: item.styleoptions, |
| | | flyTo: false |
| | | }); |
| | | |
| | | //单击事件 |
| | | wmsLyer.on(mars3d.EventType.click, function (event) { |
| | | console.log("单击了矢量数据,共" + event.features.length + "条", event); |
| | | console.log(event.layer.options.style_selected); |
| | | |
| | | |
| | | console.log(event.graphic); |
| | | /* |
| | | event.graphic.style.diffHeight = |
| | | |
| | | diffHeight: 300, |
| | | material: mars3d.MaterialUtil.createMaterial(mars3d.MaterialType.LineFlow, { |
| | | image: "img/textures/fence.png", |
| | | color: "#ffff00", |
| | | speed: 10, //速度,建议取值范围1-100 |
| | | axisY: true, |
| | | }), |
| | | */ |
| | | }); |
| | | |
| | | map.addLayer(wmsLyer); |
| | | |
| | | } |
| | | |
| | | function addGuokongLayerDIV(item) { |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | function getGuokongPointColor(qindex, value) { |
| | | |
| | | if (!value || value == null || value == 'null') { |
| | | return guokong_color_nodata; |
| | | return allLayer_color_nodata; |
| | | } |
| | | for (var key in guokong_qindex_color_list) { |
| | | if (key == qindex) { |