-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
240 lines (224 loc) · 7.22 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>湖南省违法案件地图展示——地图学期末大作业</title>
<script src="support/jquery-3.2.1.min.js" type="text/javascript"></script>
<link href="support/bootstrap/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<script src="support/bootstrap/bootstrap.min.js" type="text/javascript"></script>
<script src="support/echarts.js" type="text/javascript"></script>
<link href="support/openlayers/ol.css" rel="stylesheet" type="text/css"/>
<script src="support/openlayers/ol.js" type="text/javascript"></script>
<script src="support/openlayers_echart.es5.js" type="text/javascript"></script>
<link href="lib/map.css" rel="stylesheet" type="text/css"/>
<script src="lib/Connector.js" type="text/javascript"></script>
<script src="lib/Tools.js" type="text/javascript"></script>
<script src="lib/ImageAffair.js" type="text/javascript"></script>
<script src="lib/MapControl.js" type="text/javascript"></script>
<script src="lib/requests.js" type="text/javascript"></script>
<script src="lib/search.js" type="text/javascript"></script>
<script type="text/javascript" >
var mapcontrol = null;
$(document).ready(function () {
$('form').on('submit', function (e) {
search();
return false;
});
initSearchState();
check_map_extent = true;
$(".radio_group_1").hide();
$("#google_image_on").show();
mapcontrol = new MapControl({
target: "mapcontrol",
width: '100%',
height: '100%',
center: [112, 28],
zoom: 8
});
$.ajax({
url: "assets/湖南省行政区划.json",
method: "GET",
data: {},
success: function (geoCoordMap) {
$.get('assets/湖南省违法案件按地区统计.json', function(data) {
var convertData = function () {
var res = [];
var geoCoordMap_dict = {};
for (var i = 0; i < geoCoordMap.length; i++) {
if(geoCoordMap[i]["等级"] !== "street"){
geoCoordMap_dict[geoCoordMap[i]["行政区编号"]] = {
name: geoCoordMap[i]["行政区名称"],
coord: ol.proj.transform([parseFloat(geoCoordMap[i]["经度"]),parseFloat(geoCoordMap[i]["纬度"])], "EPSG:4326", "EPSG:3857")
};
}
}
for (var i = 0; i < data.length; i++) {
var geoCoord = geoCoordMap_dict[data[i]["现住地行政编号"]];
if (geoCoord) {
res.push({
name: geoCoord["name"],
value: geoCoord["coord"].concat(data[i]["案件数"])
});
}
}
return res;
};
option = {
title: {
text: '湖南省违法案件地图展示',
subtext: '数据来源:湖南阳光警务执法公开系统',
sublink: 'http://222.247.57.110:8099/ygjw/portal',
right: 'auto' ,
bottom: 30,
textStyle: {
color: '#FFF'
}
},
tooltip : {
trigger: 'item'
},
series : [
{
name: '违法案件数量',
type: 'effectScatter',
coordinateSystem: 'geo',
data: convertData(),
symbolSize: function (val) {
return val[2]/3;
},
encode: {
value: 2
},
showEffectOn: 'render',
rippleEffect: {
brushType: 'stroke'
},
hoverAnimation: true,
label: {
formatter: '{b}',
position: 'right',
show: true
},
itemStyle: {
color: 'red'
},
emphasis: {
label: {
show: true
}
}
}
]
};
var oe = new ADLayer(option, mapcontrol._Map, echarts);
oe._render();
// } else {
// alert(json.message);
// }
});
},
error: function () {
alert("无法连接至服务器!");
}
});
var id = getQueryVariable("id");
if(id){
mapcontrol.GotoPoint(id);
}
ShowState();
});
</script>
<style>
nav {
width: 75%;
padding: 0 1em 0 1em;
margin: auto;
}
</style>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">演示网站</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li>
<a href="index.html" style="font-weight:bold;color:black">首页—专题展示</a>
</li>
<li>
<a href="map.html">地图</a>
</li>
<li>
<a href="database.html">数据库</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">地图设置<strong class="caret"></strong></a>
<ul class="dropdown-menu">
<li>
<a onclick="changeSource('google_image')">Google影像<span id="google_image_on" class="radio_group_1"> ✔</span></a>
</li>
<li>
<a onclick="changeSource('google_image_y')">Google影像(带标签)<span id="google_image_y_on" class="radio_group_1"> ✔</span></a>
</li>
<li>
<a onclick="changeSource('google_map')">Google地图<span id="google_map_on" class="radio_group_1"> ✔</span></a>
</li>
<li>
<a onclick="changeSource('google_topo')">Google地形图<span id="google_topo_on" class="radio_group_1"> ✔</span></a>
</li>
<li>
<a onclick="changeSource('osm')">OpenStreetMap<span id="osm_on" class="radio_group_1"> ✔</span></a>
</li>
<li>
<a onclick="changeSource('amap')">高德地图<span id="amap_on" class="radio_group_1"> ✔</span></a>
</li>
<li>
<a onclick="changeSource('sea_map')">全球海图<span id="sea_map_on" class="radio_group_1"> ✔</span></a>
</li>
<li>
<a onclick="changeSource('lucc')">全球土地利用<span id="lucc_on" class="radio_group_1"> ✔</span></a>
</li>
</ul>
</li>
</ul>
<!-- <form class="navbar-form navbar-left">
<div class="form-group">
<input id="tag" type="text" class="form-control" />
<input id="date" type="date" class="form-control" />
</div>
<div class="btn-group">
<button class="btn btn-default">查询设置</button><button data-toggle="dropdown" class="btn btn-default dropdown-toggle"><span class="caret"></span></button>
<ul class="dropdown-menu">
<li>
<a onclick="toggleMapExtent()">只在地图视窗范围内搜索<span id="map_extent_on" class="check"> ✔</span></a>
</li>
<li class="divider"></li>
<li>
<a onclick="reset()">重置查询条件</a>
</li>
<li>
<a onclick="ShowState()">显示当前查询条件</a>
</li>
</ul>
</div>
<button class="btn btn-default">查询</button>
</form>-->
<ul class="nav navbar-nav navbar-right">
<li>
<a href="about.html">关于我们</a>
</li>
</ul>
</div>
</nav>
<div id="mapcontrol"></div>
<div id="popup"></div>
</body>
</html>