From 9a9916a0996b7812fe875c1932dfba70b19ea79a Mon Sep 17 00:00:00 2001 From: tix Date: Tue, 7 Feb 2017 17:49:34 +0800 Subject: [PATCH] + update origin stations map --- public/js/json_tree.js | 2 +- public/js/mod.js | 50 +- routes/origin.js | 4 +- views/inc/desertification.ejs | 8 +- views/inc/forest.ejs | 10 +- views/inc/grass.ejs | 15 +- views/inc/{water.ejs => hydrology.ejs} | 14 +- views/inc/meteorological.ejs | 13 +- views/inc/soil_and_water_conservation.ejs | 7 +- views/inc/wetland.ejs | 537 ++++++++++++++++++---- views/index.html | 10 - views/origin.html | 3 + 12 files changed, 534 insertions(+), 139 deletions(-) rename views/inc/{water.ejs => hydrology.ejs} (99%) diff --git a/public/js/json_tree.js b/public/js/json_tree.js index 5856e61..a13b335 100644 --- a/public/js/json_tree.js +++ b/public/js/json_tree.js @@ -4,7 +4,7 @@ var json_tree_nav = '[{"text":"遥感监测","nodes":[{"text":"土地利用/土 var json_tree_intro = '[{"text":"自然地理概况","nodes":[{"text":"地理位置","href":"/intro/location"},{"text":"地质地貌","href":"/intro/landform"},{"text":"气候","href":"/intro/climate"},{"text":"水文","href":"/intro/hydrology"},{"text":"土壤","href":"/intro/soil"},{"text":"植被","href":"/intro/vegetation"},{"text":"野生动物","href":"/intro/wildlife"}]},{"text":"社会经济条件","nodes":[{"text":"行政区划","href":"/intro/administrative_area"},{"text":"人口及民族","href":"/intro/population"},{"text":"土地","href":"/intro/land"},{"text":"交通","href":"/intro/traffic"},{"text":"通讯","href":"/intro/communication"}]}]'; -var json_tree_origin = '[{"text":"遥感监测","nodes":[{"text":"土地利用/土地覆盖","href":"/origin/land_use"},{"text":"生态环境质量状况","href":"/origin/ecology"},{"text":"牧草产量","href":"/origin/forage_yield"},{"text":"土壤侵蚀","href":"/origin/soil_erosion"}]},{"text":"地面监测","nodes":[{"text":"气象监测","href":"/origin/meteorological"},{"text":"水文水资源监测","href":"/origin/water"},{"text":"草地生态监测","href":"/origin/grass"},{"text":"森林监测","href":"/origin/forest"},{"text":"沙化土地监测","href":"/origin/desertification"},{"text":"湿地监测","href":"/origin/wetland"},{"text":"水土保持监测","href":"/origin/soil_and_water_conservation"},{"text":"环境质量监测","href":"/origin/env_quality_monitoring"}]},{"text":"社会经济调查","nodes":[{"text":"人口","href":"#"},{"text":"社会经济","href":"#"},{"text":"环境保护机构","href":"#"},{"text":"污染源","href":"#"},{"text":"生态移民","href":"#"},{"text":"工程项目","href":"#"}]}]'; +var json_tree_origin = '[{"text":"遥感监测","nodes":[{"text":"土地利用/土地覆盖","href":"/origin/land_use"},{"text":"生态环境质量状况","href":"/origin/ecology"},{"text":"牧草产量","href":"/origin/forage_yield"},{"text":"土壤侵蚀","href":"/origin/soil_erosion"}]},{"text":"地面监测","nodes":[{"text":"气象监测","href":"/origin/meteorological"},{"text":"水文水资源监测","href":"/origin/hydrology"},{"text":"草地生态监测","href":"/origin/grass"},{"text":"森林监测","href":"/origin/forest"},{"text":"沙化土地监测","href":"/origin/desertification"},{"text":"湿地监测","href":"/origin/wetland"},{"text":"水土保持监测","href":"/origin/soil_and_water_conservation"},{"text":"环境质量监测","href":"/origin/env_quality_monitoring"}]},{"text":"社会经济调查","nodes":[{"text":"人口","href":"#"},{"text":"社会经济","nodes":[{"text":"农牧业产值、经济收入及费用","href":"#"},{"text":"基本情况","href":"#"},{"text":"畜产品产量统计表","href":"#"},{"text":"畜牧业生产效益","href":"#"},{"text":"禁牧减畜统计表","href":"#"},{"text":"草原建设","href":"#"},{"text":"草食牲畜数量","href":"#"}]},{"text":"环境保护机构","href":"#"},{"text":"污染源","href":"#"},{"text":"生态移民","href":"#"},{"text":"工程项目","href":"#"}]}]'; var json_tree_ei = '[{"text":"生态系统宏观结构","nodes":[{"text":"分类面积","href":"/ei/classification_area"},{"text":"变化率","href":"/ei/rate_of_change"},{"text":"动态度","href":"/ei/dynamic_degree"},{"text":"宏观结构变化指数","href":"/ei/emsci"},{"text":"群落结构特征"}]},{"text":"生态系统质量","nodes":[{"text":"草地退化/恢复"},{"text":"生产力"},{"text":"地表覆盖"},{"text":"环境质量"},{"text":"多年冻土"}]},{"text":"生态系统服务功能","nodes":[{"text":"水分调节"},{"text":"持水能力"},{"text":"径流调节"},{"text":"水土保持"},{"text":"防风固沙"},{"text":"牧草供给"},{"text":"水供给"},{"text":"栖息地隐蔽性"},{"text":"栖息地食物供给"},{"text":"栖息地水源供给"},{"text":"人类干扰程度"}]},{"text":"生态系统变化的影响","nodes":[{"text":"气候变化"},{"text":"人类活动"}]}]'; diff --git a/public/js/mod.js b/public/js/mod.js index b459ff8..bc2528a 100644 --- a/public/js/mod.js +++ b/public/js/mod.js @@ -8,7 +8,6 @@ $('.navbar-nav li a').each(function () { else { $('.navbar-nav li').first().removeClass('active'); } - }); function onEachFeature(feature, layer) { @@ -25,3 +24,52 @@ function onEachFeature(feature, layer) { // $(".nav-list li").removeClass("active"); // $(this).addClass("active"); // }); + +function loadStationMap(station) { + var base_map = L.tileLayer('http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', { + maxZoom: 18 + }); + + var over_geojson_sjy_bound_2nd = new L.GeoJSON.AJAX("/json/sjy_bound_2nd.geojson", { + style: { + "color": "#de950d", + "weight": 2, + "opacity": 1, + "fillOpacity": 0 + } + }); + + var over_geojson_station = new L.GeoJSON.AJAX("/api/gis/geojson/" + station, { + pointToLayer: function (feature, latlng) { + return L.circleMarker(latlng, { + radius: 4, + fillColor: "#0aff3c", + color: "#000", + weight: 1, + opacity: 1, + fillOpacity: 0.8 + }) + }, + onEachFeature: onEachFeature + }); + + var map = L.map('map', { + layers: [ + base_map, + over_geojson_station, + over_geojson_sjy_bound_2nd + ], + minZoom: 6, + maxZoom: 17, + zoomIn: 1, + zoomOut: 1, + zoomControl: false + }).setView([34, 96], 6); + + var bounds = new L.LatLngBounds(new L.LatLng(31, 103), new L.LatLng(38, 89)); + map.fitBounds(bounds); + + $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { + map.invalidateSize(); + }); +} \ No newline at end of file diff --git a/routes/origin.js b/routes/origin.js index 56df69f..c2f260b 100644 --- a/routes/origin.js +++ b/routes/origin.js @@ -62,11 +62,11 @@ router.get('/forest', function (req, res, next) { }); -router.get('/water', function (req, res, next) { +router.get('/hydrology', function (req, res, next) { res.render('origin', { page_title: '水文水资源监测', page_cont: 'inc', - inc_tag: 'water' + inc_tag: 'hydrology' }); }); diff --git a/views/inc/desertification.ejs b/views/inc/desertification.ejs index fdd6f3d..77a4623 100644 --- a/views/inc/desertification.ejs +++ b/views/inc/desertification.ejs @@ -1588,9 +1588,9 @@