-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaggregate.html
More file actions
86 lines (81 loc) · 2.2 KB
/
aggregate.html
File metadata and controls
86 lines (81 loc) · 2.2 KB
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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<link href="https://developer.geon.kr/js/odf/odf.css" rel="stylesheet">
<script type="text/javascript" src="https://developer.geon.kr/js/odf/odf.min.js"></script>
</head>
<body>
<div id="map" class="odf-view" style="height:550px;"></div>
</body>
<script>
/* 맵객체 생성 (외부에서 사용할 때는 proxyURL, proxyParam 옵션이 필요합니다.) */
var mapContainer = document.getElementById('map');
var coord = new odf.Coordinate(199312.9996,551784.6924);
var mapOption = {
center : coord,
zoom : 11,
projection : 'EPSG:5186',
//proxyURL: 'proxyUrl.jsp',
//proxyParam: 'url',
vWorldURL : 'https://gsapi.geon.kr/map/api/vworld/wmts',
basemap : {
vWorld : ['vWorldBase', 'vWorldWhite', 'vWorldMidnight', 'vWorldHybrid', 'vWorldSatellite'],
},
};
var map = new odf.Map(mapContainer, mapOption);
/* 분석 대상 폴리곤 레이어 추가*/
var polygonLayer = odf.LayerFactory.produce('geoserver', {
method : 'get',
server : 'https://geoserver.geon.kr/geoserver', // 분석결과 레이어가 발행된 주소
layer : 'geonpaas:L100000254',
service : 'aggregate',
target : 'DRAWING_NO',
});
polygonLayer.setMap(map);
polygonLayer.fit();
/*분석 스타일 생성*/
var aggregateStyle = odf.StyleFactory.produceFunction([ {
seperatorFunc : "default",
style : [ {
stroke : {
color : [ 132, 229, 252, 0.95 ],
width : 4
},
text : {
font : '20pt Calibri,sans-serif',
fill : {
color : '#000000'
},
}
},
//전체도형의 중심에 라벨생성
{
geometry : function(feature) {
var geometry = feature.getGeometry();
return geometry.getInteriorPoints();
},
image : {
circle : {
fill : {
color : '#CC70B4'
},
stroke : {
color : "#CC70B4",
width : 1
}
},
},
} ],
callbackFunc : function(style, feature, resolution) {
var maxRadius = 5;
var sizeDegree = Number(feature.get("sizeDgree"));
var radius = maxRadius * sizeDegree;
var count = feature.get("DRAWING_NO");
style[0].getText().setText(count + "");
style[1].getImage().setRadius(radius);
},
} ]);
polygonLayer.setStyle(aggregateStyle);
</script>
</html>