-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
345 lines (293 loc) · 10.8 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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>oztitanik</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.12/proj4.js"></script>
<script src="https://code.highcharts.com/maps/highmaps.js"></script>
<script src="https://code.highcharts.com/maps/modules/data.js"></script>
<script src="https://code.highcharts.com/mapdata/custom/world.js"></script>
<script src="https://code.highcharts.com/mapdata/index.js"></script>
<script src="https://rawgithub.com/highcharts/draggable-points/master/draggable-points.js"></script>
<script src="https://code.highcharts.com/maps/modules/accessibility.js"></script>
<script src="https://code.highcharts.com/maps/highmaps.js"></script>
<script src="https://code.highcharts.com/maps/modules/exporting.js"></script>
<script src="https://code.highcharts.com/maps/modules/offline-exporting.js"></script>
<script src="/js/themes/gray.js"></script>
</head>
<style>
body{
background-color: rgb(36, 30, 59);
}
.highcharts-figure,
.highcharts-data-table table {
min-width: 320px;
max-width: 800px;
margin: 40px auto auto auto;
}
.highcharts-data-table table {
font-family: Verdana, sans-serif;
border-collapse: collapse;
border: 1px solid #ebebeb;
margin: 10px auto;
text-align: center;
width: 100%;
max-width: 500px;
}
.highcharts-data-table caption {
padding: 1em 0;
font-size: 1.2em;
color: rgb(95,99,104);
}
.highcharts-data-table th {
font-weight: 600;
padding: 0.5em;
}
.highcharts-data-table td,
.highcharts-data-table th,
.highcharts-data-table caption {
padding: 0.5em;
}
.highcharts-data-table thead tr,
.highcharts-data-table tr:nth-child(even) {
background: #f8f8f8;
}
.highcharts-data-table tr:hover {
background: #f1f7ff;
}
input[type="number"] {
min-width: 50px;
}
</style>
</body>
<div class="container mt-3">
<div class="row">
<div class="col-md-4">
<button type="button" class="btn btn-info" data-placement="left" data-bs-toggle="tooltip" title="Rota optimizasyonunun denizcilik endüstrisi ve limanlar için birçok avantajı vardır. Rota optimizasyonu, doğru rota planlamasına ve etkin tahmini varış zamanına yardımcı olur. Rota optimizasyonu, doğru teslimatla işletmeye ve müşteriye fayda sağlar ve rota optimizasyonu, nakliye şirketlerinin daha verimli olmasına ve zamandan ve paradan tasarruf etmesine yardımcı olur. Filo rotalarını optimize ederek maliyetler azaltılabilir ve küresel tedarik zinciri yönetimi daha iyi kontrol edilebilir.!">
Rota Optimizasyon
</button>
</div>
<div class="col-md-8">
</div>
</div>
</div>
<figure class="highcharts-figure">
<div id="container"></div>
<div class="row" align="center">
<div class="container mt-3">
<button type="button" class="btn btn-md btn-secondary" data-bs-toggle="popover" data-placement="left" title="Title" data-bs-content="Proje Bilgisi">Proje Bilgisi</button>
</div>
</div>
</figure>
<script>
var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
return new bootstrap.Popover(popoverTriggerEl)
})
</script>
<script>
// Initialize tooltips
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl)
})
</script>
</body>
<script>
const all = function (res) {
function renderArrow(chart, startPoint, stopPoint) {
const triangle = function(x, y, w, h) {
return [
'M', x + w / 2, y,
'L', x + w, y + h,
x, y + h,
'Z'
];
};
var arrow = chart.arrows[startPoint.options.id];
if (!arrow) {
arrow = chart.arrows[startPoint.options.id] = chart.renderer.path().add(startPoint.series.group);
}
const x1 = startPoint.plotX;
const x2 = stopPoint.plotX;
const y1 = startPoint.plotY;
const y2 = stopPoint.plotY;
const distance = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
const h = Math.min(Math.max(distance / 3, 10), 30);
const w = h / 1.5;
if (distance > h * 2) {
const offset = h / 2 / distance;
const y = y1 + offset * (y2 - y1);
const x = x1 + offset * (x2 - x1);
const arrowPath = triangle(x - w / 2, y, w, h);
const angle = Math.round(Math.atan2(y2 - y1, x2 - x1) * 180 / Math.PI) + 90;
arrow.attr({
d: arrowPath.join(' '),
transform: `rotate(${angle} ${x} ${y})`,
fill: 'deepskyblue',
zIndex: 10,
visibility: 'visible'
});
} else {
arrow.attr({
visibility: 'hidden'
});
}
}
function renderArrows() {
if (!this.arrows) {
this.arrows = {};
}
const points = this.series[1].points;
points.reduce((start, stop) => {
renderArrow(this, start, stop);
return stop;
});
}
Highcharts.theme = {
chart: {
backgroundColor: {
linearGradient: [0, 0, 500, 500],
stops: [
[0, 'rgb(138, 180, 248)'], //rgb(255, 255, 255)
[1, 'rgb(148, 210, 165)'] //rgb(240, 240, 255)
]
},
},
title: {
style: {
color: 'rgb(251, 248, 243)',
font: 'bold 15px "Trebuchet MS", Verdana, sans-serif'
}
},
subtitle: {
style: {
color: 'black',
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
}
},
legend: {
itemStyle: {
font: '9pt Trebuchet MS, Verdana, sans-serif',
color: 'black',
},
itemHoverStyle:{
color: 'white'
}
}
};
// Apply the theme
Highcharts.setOptions(Highcharts.theme);
// Initiate the chart
Highcharts.mapChart('container', {
title: {
text: "Marine Traffic"
},
chart: {
animation: false,
events: {
load: renderArrows,
redraw: renderArrows
}
},
colors: ['rgba(19,64,117,0.05)', 'rgba(19,64,117,0.2)', 'rgba(19,64,117,0.4)',
'rgba(19,64,117,0.5)', 'rgba(19,64,117,0.6)', 'rgba(19,64,117,0.8)', 'rgba(19,64,117,1)'],
mapNavigation: {
enabled: true,
buttonOptions: {
verticalAlign: 'bottom'
}
},
legend: {
enabled: false
},
tooltip: {
headerFormat: '',
pointFormat: '<b>{point.type}</b><br>Lat: {point.lat}, Lon: {point.lon}'
},
series: [{
// Use the gb-all map with no data as a basemap
name: 'Great Britain',
borderColor: 'gray',
nullColor: 'rgb(251, 248, 243)', //rgba(200, 200, 200, 0.3) rgb(148, 210, 165)
showInLegend: false,
mapData: Highcharts.maps['custom/world']
},
{
name: 'Separators',
type: 'mapline',
nullColor: 'black',
showInLegend: false,
enableMouseTracking: false,
accessibility: {
enabled: true
}
},
{
type: "mappoint",
lineWidth: 2,
color: "black",
accessibility: {
point: {
valueDescriptionFormat: '{xDescription}. Lat: {point.lat:.2f}, lon: {point.lon:.2f}.'
}
},
states: {
hover: {
color: 'red'
}
},
marker: {
enabled: false
},
data: res
}, {
type: "mappoint",
name: "Cities",
color: 'deepskyblue',
marker: {
enabled: false,
},
/* data: [{
id: '0',
lat: 41.108679365839755,
lon: 16.849069442461108,
}, {
id: '1',
lat: 20.65378710700787,
lon: 14.759846388659303,
}, {
id: '2',
lat: 11.90017321198485,
lon: -62.16516614442158,
}, {
id: '3',
lat: 61.90017321198485,
lon: -92.16516614442158,
}]*/
}]
});
}
$.ajax({
type: 'GET',
url: 'API Gateway url',
dataType: 'json',
data:{
type: "Tankers",
limit:"4"
},
success: function(res)
{
console.log(res);
all(res)
},
error: function(xhr, ajaxOptions, thrownError)
{
},
});
</script>
</html>