| | |
| | | $(function() { |
| | | loadMap(); |
| | | //getReallyData(); |
| | | getReallyData(); |
| | | //getRegulatoryUnitChartData("",""); |
| | | //bindEvent(); |
| | | }) |
| | | // 加载地图 |
| | | let map=null; |
| | | var countries = []; |
| | | var countriesOverlay = new T.D3Overlay(init,redraw); |
| | | var countriesOverlay1 = new T.D3Overlay(init1,redraw1); |
| | | function loadMap() { |
| | | let map = new T.Map('map_div'); |
| | | map = new T.Map('map_div'); |
| | | map.centerAndZoom(new T.LngLat(116.38, 39.9), 11); |
| | | |
| | | var control = new T.Control.Zoom(); |
| | |
| | | |
| | | // 获取数据库真实数据 |
| | | function getReallyData() { |
| | | let url = window.location.protocol + "//" + window.location.host + "/bjfw/geotdp/index/indexCollect"; |
| | | let url = window.location.protocol + "//" + window.location.host + "/bjfw/system/project"; |
| | | $.get(url,function(res){ |
| | | |
| | | var data = res.projects; |
| | | showProjectPoint(data); |
| | | }) |
| | | } |
| | | //地图上展示项目点 |
| | | function showProjectPoint(data){ |
| | | var projectIcon = new T.Icon({ |
| | | iconUrl: '/bjfw/images/icons/6.png', |
| | | iconSize: new T.Point(30, 30), |
| | | iconAnchor: new T.Point(6, 40), |
| | | }); |
| | | var centerMarker = new T.Marker(new T.LngLat(center.lng, center.lat), { title: "项目",icon:icon}); |
| | | |
| | | var proj = infoWindowProject(onProject); |
| | | addClickHandler(proj, centerMarker); |
| | | } |
| | | // 页面数据赋值 |
| | | function pageAssignment(reallyData) { |
| | | for ( let key in reallyData) { |