-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
232 lines (195 loc) · 7.14 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
<html>
<head>
<script src="https://cdn.anychart.com/releases/v8/js/anychart-base.min.js"></script>
<script src="https://cdn.anychart.com/releases/v8/js/anychart-ui.min.js"></script>
<script src="https://cdn.anychart.com/releases/v8/js/anychart-exports.min.js"></script>
<script src="https://cdn.anychart.com/releases/v8/js/anychart-map.min.js"></script>
<script src="https://cdn.anychart.com/releases/v8/js/anychart-data-adapter.min.js"></script>
<script src="https://cdn.anychart.com/geodata/latest/custom/world/world.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.15/proj4.js"></script>
<script src="./cities.js"></script>
<link href="https://cdn.anychart.com/releases/v8/css/anychart-ui.min.css" type="text/css" rel="stylesheet">
<link href="https://cdn.anychart.com/releases/v8/fonts/css/anychart-font.min.css" type="text/css" rel="stylesheet">
<style type="text/css">
html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
#mapcontainer {
width: 100%;
height: calc(100% - 60px);
}
.toolbar {
padding: 15px;
width: 100%;
height: 80px;
background: #3A4750;
font-family: sans-serif;
clear: both;
}
* {
box-sizing: border-box;
}
body {
margin: 0px;
padding: 0px;
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-color: #130f40;
font-family: 'Lato' !important;
}
.search-box {
width: 100%;
height: 50px;
position: relative;
}
.input-search {
height: 50px;
width: 50px;
border-style: none;
padding: 10px;
font-size: 18px;
letter-spacing: 2px;
outline: none;
border-radius: 25px;
transition: all .5s ease-in-out;
background-color: #22a6b3;
padding-right: 40px;
color: #fff;
}
.input-search::placeholder {
color: rgba(255, 255, 255, .5);
font-size: 18px;
letter-spacing: 2px;
font-weight: 100;
}
.btn-search {
width: 50px;
height: 50px;
border-style: none;
font-size: 20px;
font-weight: bold;
outline: none;
cursor: pointer;
border-radius: 50%;
position: absolute;
right: 0px;
color: #ffffff;
background-color: transparent;
pointer-events: painted;
background: url("./search.png");
background-size: 35px;
background-repeat: no-repeat;
background-position: center;
}
.btn-search:focus~.input-search {
width: 300px;
border-radius: 0px;
background-color: transparent;
border-bottom: 1px solid rgba(255, 255, 255, .5);
transition: all 500ms cubic-bezier(0, 0.110, 0.35, 2);
}
.input-search:focus {
width: 300px;
border-radius: 0px;
background-color: transparent;
border-bottom: 1px solid rgba(255, 255, 255, .5);
transition: all 500ms cubic-bezier(0, 0.110, 0.35, 2);
}
</style>
</head>
<body>
<div class="toolbar">
<div class="search-box">
<button class="btn-search"><i class="fas fa-search"></i></button>
<input type="text" class="input-search" placeholder="Type to Search...">
</div>
</div>
<div id="mapcontainer">
<div id="map"></div>
</div>
<div id="line"> </div>
<script>
var map;
anychart.onDocumentReady(function () {
anychart.data.loadJsonFile(
// The data used in this sample can be obtained from the CDN
'https://cdn.anychart.com/samples-data/maps-general-features/world-mammal-species-theatened.json',
function (data) {
map = anychart.map();
/* set map title and title settings
map
.title()
.enabled(true)
.padding([10, 0, 10, 0])
.text('World Map with Weather Data\n');*/
// Sets geodata using https://cdn.anychart.com/geodata/latest/custom/world/world.js
map.geoData('anychart.maps.world');
// set chart padding
map.padding(0);
// set polygon marquee colors
map.selectPolygonMarqueeFill('#333 .3');
map.selectPolygonMarqueeStroke('#333');
// create bubble series
var series = map.bubble(data);
// set chart bubble settings
map.minBubbleSize('.7%').maxBubbleSize('7%');
// set bubble series settings
series.fill('red .6').stroke('#333').selectionMode('multi-select');
// listen pointsSelect event
map.listen('pointsSelect', function () {
// get selected points
var points = map.getSelectedPoints();
// update chart title
updateChartTitle(points);
});
// create zoom controls
var zoomController = anychart.ui.zoom();
zoomController.render(map);
// set container id for the chart
map.container('map');
// initiate chart drawing
map.draw();
}
);
});
// helper function to update chart title on points select
function updateChartTitle(points) {
// get selected points sizes sum
var selectedPointsSize = points.reduce(function (sum, point) {
return sum + point.get('size');
}, 0);
// set new chart title
map
.title()
.text(
'World Mammals Species Threatened , by country\n' +
selectedPointsSize +
' Mammal Species threatened in selected area in 2018 '
);
}
</script>
<script>
anychart.onDocumentReady(function () {
// Creates data.
var dataSet = anychart.data.set([
['Point A', 231],
['Point B', 131],
['Point C', 212],
['Point D', 94]
]);
var data = dataSet.mapAs({ x: 0, value: 1 });
var chart = anychart.line(data);
chart.title('Create data set');
chart.container('line');
chart.draw();
});
</script>
</body>
</html>