-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathoil_vitra_design_museum.html
686 lines (632 loc) · 29.6 KB
/
oil_vitra_design_museum.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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" prefix="og: http://ogp.me/ns#" class="js touch progressive-image no-reduced-motion no-edge no-ie css-mask no-inline-video no-desktop retina no-safari no-old-safari chrome no-ios no-android-browser no-firefox no-fallback no-aow enhanced-layout" data-layout-name="r71eb">
<head>
<meta charset="utf-8">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-136089997-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-136089997-1');
</script>
<!-- Note: plugin scripts must be included after the tracking snippet. -->
<script src="https://ipmeta.io/plugin.js"></script>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4035003913367801"
crossorigin="anonymous"></script>
<script>
provideGtagPlugin({
apiKey: '18bf8f1d26cb517fdf42fd4d789a01445f8245eab896aa42997500bf9f5d5702',
serviceProvider: 'dimension1',
networkDomain: 'dimension2',
networkType: 'dimension3',
});
</script>
<meta name="google-adsense-account" content="ca-pub-4035003913367801">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="icon" type="image/png" href="./img/oilmap.png" sizes="16x16"><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<meta name="author" content="Roque Leal" />
<meta name="copyright" content="https://oilmap.xyz" />
<meta property="fb:admins" content="1573187928" />
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Oil Map" />
<meta name="description" content="🛢️ Discover World Oil Map 2021, information & knowledge about Upstream and Downstream activities for Oil and Gas.✔️">
<meta name="keywords" content="OIL, MAP, CRUDE, PETROLEUM, OIL&GAS, INTELLIGENCE, MAPPING, MAPBOX, GAS, PIPELINE" />
<meta property="og:type" content="website" />
<meta property="og:image" content="https://oilmap.xyz/img/preview.jpg"/>
<meta property="og:image:width" content="400" />
<meta property="og:image:height" content="300" />
<meta property="og:title" content="World Oil Map 2024" />
<meta property="og:description" content="🥇 Succeed in any environment with intelligence location world data for Upstream and Downstream activities Oil and Gas 🗺️" />
<meta property="og:url" content="https://oilmap.xyz" />
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@roqueleal08">
<meta name="twitter:title" content="World Oil Map 2024">
<meta name="twitter:description" content="🥇 Succeed in any environment with intelligence location world data for Upstream and Downstream activities Oil and Gas 🗺️">
<meta name="twitter:creator" content="@roqueleal08">
<meta name="twitter:image" content="https://oilmap.xyz/img/preview.jpg">
<title>🥇 World Oil Map 2021</title>
<link rel="canonical" href="https://www.oilmap.xyz/" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-US" />
<link rel="alternate" href="https://www.oilmap.xyz/ar" hreflang="ar-AE" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-AE" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-AM" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-AU" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-AZ" />
<link rel="alternate" href="https://www.oilmap.xyz/fr" hreflang="fr-BE" />
<link rel="alternate" href="https://www.oilmap.xyz/ar" hreflang="ar-BH" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-BH" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-BW" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-BY" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-CA" />
<link rel="alternate" href="https://www.oilmap.xyz/fr" hreflang="fr-CA" />
<link rel="alternate" href="https://www.oilmap.xyz/fr" hreflang="fr-CF" />
<link rel="alternate" href="https://www.oilmap.xyz/fr" hreflang="fr-CH" />
<link rel="alternate" href="https://www.oilmap.xyz/fr" hreflang="fr-CI" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-CL" />
<link rel="alternate" href="https://www.oilmap.xyz/fr" hreflang="fr-CM" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-CO" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-EG" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-ES" />
<link rel="alternate" href="https://www.oilmap.xyz/fr" hreflang="fr-FR" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-GE" />
<link rel="alternate" href="https://www.oilmap.xyz/fr" hreflang="fr-GN" />
<link rel="alternate" href="https://www.oilmap.xyz/fr" hreflang="fr-GQ" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-GW" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-HK" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-ID" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-IE" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-IL" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-IN" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-HN" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-AR" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-SV" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-PR" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-DO" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-EC" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-GT" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-PE" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-BO" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-NI" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-VE" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-PA" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-CR" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-UY" />
<link rel="alternate" href="https://www.oilmap.xyz/es" hreflang="es-PY" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-AG" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-BS" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-TC" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-TT" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-SR" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-BM" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-BB" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-BZ" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-GD" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-KY" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-LC" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-MS" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-KN" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-AI" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-VC" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-GY" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-VG" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-PR" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-DM" />
<link rel="alternate" href="https://www.oilmap.xyz/" hreflang="en-JM" />
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@id": "https://www.oilmap.xyz/",
"@type": "Organization",
"name": "OilMap",
"url": "https://www.oilmap.xyz/",
"logo": "https://oilmap.xyz/img/preview.jpg",
"subOrganization": {
"@type": "Organization",
"name": "OilMap",
"url": "https://oilmap.xyz",
"@id": "https://oilmap.xyz"
},
"contactPoint": [
{
"@type": "ContactPoint",
"telephone": "+58-412-318-8208",
"contactType": "sales",
"areaServed": "VE"
},
{
"@type": "ContactPoint",
"telephone": "+58-412-318-8208",
"contactType": "technical support",
"areaServed": "VE",
"availableLanguage": ["FR", "ES"]
},
{
"@type": "ContactPoint",
"telephone": "+58-412-318-8208",
"contactType": "customer support",
"areaServed": "VE",
"availableLanguage": ["FR", "ES"]
}
],
"sameAs": [
"https://www.linkedin.com/in/lealrlx",
"https://www.twitter.com/roqueleal08"
]
}
</script>
<link rel="icon" type="image/png" href="./img/oilmap.png" sizes="16x16">
<link rel="canonical" href="https://www.oilmap.xyz"/>
<link rel="alternative" hreflang="en" href="https://www.oilmap.xyz/">
<link rel="alternative" hreflang="es" href="https://www.oilmap.xyz/es.html">
<link rel="alternative" hreflang="ar" href="https://www.oilmap.xyz/ar.html">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<link href="./js/assembly.min.css" rel="stylesheet">
<script async="" defer="" src="./js/assembly.js"></script>
<script src="./js/jquery.min.js"></script>
<body class="prose">
<header class="bg-darken75 color-black h-auto-mm h6 ">
<div class="flex-parent flex-parent--space-between-main w-full">
<div class="about-header flex-child mr24 mt30 mb50 txt-bold" style="color: #F0B823; text-shadow: 1px 1px 2px rgb(8, 8, 8), 0 0 1em rgb(253, 253, 255);">
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-language/v0.10.1/mapbox-gl-language.js'></script>
<script src="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v4.5.1/mapbox-gl-geocoder.min.js"></script><link
rel="stylesheet"
href="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v4.5.1/mapbox-gl-geocoder.css"
type="text/css"/>
<script src='https://api.mapbox.com/mapbox-gl-js/v2.2.0/mapbox-gl.js'></script>
<link href='https://api.mapbox.com/mapbox-gl-js/v2.2.0/mapbox-gl.css' rel='stylesheet' />
</header>
<link rel="stylesheet" href="./css/style.css">
<link rel="stylesheet" type="text/css" href="./js/cookieconsent.min.css">
</head>
<body>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WXJ6F8F"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<nav id="menu"></nav>
<div id='map'></div>
<script>
mapboxgl.accessToken = 'pk.eyJ1Ijoicm9xdWVsZWFsIiwiYSI6ImNqaHVzZTA4ODBkZjczdmt0cTNrbGo1ZWEifQ.m7xOPPWAFsY-A4cAr5nDAw';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/roqueleal/cltfw9p5p00tv01nwbmm07efv',
center: [18.369141,21.043491],
zoom: 3
});
mapboxgl.setRTLTextPlugin('https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.1.0/mapbox-gl-rtl-text.js');
map.addControl(new MapboxLanguage());
</script>
<!-- modal-->
<div id="aboutModal" class="modal" style="display: none;">
<!-- modal content -->
<div class="modal-content">
<span class="close">×</span>
<img class="logo" src="./img/oilmap.png" style="width:50%;max-width:70px"><p></p>
<h1><a href="https://www.roqueleal.me" target="_blank">World Oil Map 2024</a></h1>
🌎🛢️ This Map its a web Location-Intelligence application supported and updated using Country official spatial database services and others sources related to the Oil and Gas sector. It is built to assist academic research and teaching as well as the general public. </a><br>
<h2><a href="https://oilmap.xyz/prices/oilprices.html" target="_blank">Crude Oil Price Map</a></h2>
You can also display and check in real time the prices of crude oil in <a href="https://oilmap.xyz/prices/oilprices.html" target="_blank">Oil Prices Map</a>.<p></p>
I'm <a href="https://www.roqueleal.me" target="_blank" >Roque Leal,
</a> allow me to invite you to collaborate to update and share this information. Involving your data we will have more updated information. You can comment and write to me<a href="mailto:roqueleal@gmail.com"> roqueleal@gmail.com
</a>.
Special thanks to <a href="https://blog.mapbox.com/bringing-data-to-life-with-powerbi-ccaf214eaf16" target="_blank">Mapbox</a> for sharing inspiration and technology in the deep and dynamic visualization of our data.<p>
</p>Its distributed through GPL Open Source License. Visit the repository of this project available in <a href="https://github.com/roqueleal/oilmap" target="_blank">Github</a>.<p></p>
<a href="https://github.com/roqueleal/oilmap" target="_blank"><img src="./img/git.png" style="width:300%;max-width:200px" alt="Link to this page" ></a>
<p>Open Data Certificate™ available in <a href="https://certificates.theodi.org/en/datasets/220195/certificate" target="_blank">ODI</a>.<p></p>
<a href="https://certificates.theodi.org/en/datasets/220195/certificate" target="_blank"><img src="./img/odi.png" style="width:150%;max-width:150px" alt="Link to this page"></a> </div>
</div>
</div>
<!-- menu -->
<!-- menu -->
<script>
// inicio CLUSTERNEWS
// fin CLUSTERNEWS
// INICIO MENU
var toggleableLayerIds = ['PRODUCTION', 'BID-ROUNDS','EXPLORATION','REFINERIES','OIL-PIPELINE','GAS-PIPELINE'];
for (var i = 0; i < toggleableLayerIds.length; i++) {
var id = toggleableLayerIds[i];
var link = document.createElement('a');
link.href = '#';
link.className = 'active';
link.textContent = id;
link.onclick = function (e) {
var clickedLayer = this.textContent;
e.preventDefault();
e.stopPropagation();
var visibility = map.getLayoutProperty(clickedLayer, 'visibility');
if (visibility === 'visible') {
map.setLayoutProperty(clickedLayer, 'visibility', 'none');
this.className = '';
} else {
this.className = 'active';
map.setLayoutProperty(clickedLayer, 'visibility', 'visible');
}
};
var layers = document.getElementById('menu');
layers.appendChild(link);
}
// fin MENU
// INICIO MENU
var toggleableLayerIds = ['DEPOSITS'];
for (var i = 0; i < toggleableLayerIds.length; i++) {
var id = toggleableLayerIds[i];
var link = document.createElement('a');
link.href = '#';
link.className = 'focus';
link.textContent = id;
link.onclick = function (e) {
var clickedLayer = this.textContent;
e.preventDefault();
e.stopPropagation();
var visibility = map.getLayoutProperty(clickedLayer, 'visibility');
if (visibility === 'visible') {
map.setLayoutProperty(clickedLayer, 'visibility', 'none');
this.className = '';
} else {
this.className = 'active';
map.setLayoutProperty(clickedLayer, 'visibility', 'visible');
}
};
var layers = document.getElementById('menu');
layers.appendChild(link);
}
// fin MENU
// interacion inicio hover
var popup = new mapboxgl.Popup({
closeButton: false,
closeOnClick: false
});
map.on('mouseenter', 'DEPOSITS', function(e) {
// Change the cursor style as a UI indicator.
map.getCanvas().style.cursor = 'pointer';
var coordinates = e.features[0].geometry.coordinates.slice();
var description = e.features[0].properties.description;
// Ensure that if the map is zoomed out such that multiple
// copies of the feature are visible, the popup appears
// over the copy being pointed to.
while (Math.abs(e.lngLat.lng - coordinates[0]) > 180) {
coordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360;
}
// Populate the popup and set its coordinates
// based on the feature found.
popup.setLngLat(e.lngLat)
.setHTML('<dt>' + e.features[0].properties.NAME + '</dt>'+'<dt>'+ e.features[0].properties.OTHERINFO + '</dt>' + e.features[0].properties.RESINFO + '</dt>' )
.addTo(map);
map.on('mouseleave', 'DEPOSITS', function() {
map.getCanvas().style.cursor = '';
popup.remove();
});
});
// interacion fin hover
// interacion inicio popup
map.on('mousemove', function(event) {
if (map.loaded()) {
var features = map.queryRenderedFeatures(event.point, {
layers: ['REFINERIES', 'EXPLORATION', 'BID-ROUNDS','PRODUCTION', 'NEWS']
});
map.getCanvas().style.cursor = features.length ? 'pointer' : '';
}
});
window.addEventListener('resize', () => {
mapReset();
})
// interacion refinerias
map.on('click', function(e) {
var features = map.queryRenderedFeatures(e.point, {
layers: ['REFINERIES'] // replace this with the name of the layer
});
if (!features.length) {
return;
}
var feature = features[0];
var popup = new mapboxgl.Popup ()
.setLngLat(feature.geometry.coordinates)
.setHTML('<dd>' + feature.properties.Name + feature.properties.Descriptio + '</dd>')
.setLngLat(feature.geometry.coordinates)
.addTo(map);
});
window.addEventListener('resize', () => {
mapReset();
})
// interacion fin refinerias
// interacion inicio bloquesar
map.on('click', 'EXPLORATION-AREAS', function (e) {
new mapboxgl.Popup()
.setLngLat(e.lngLat)
.setHTML('<dt>' + e.features[0].properties.Name + '</dt>'+'<dt>'+ e.features[0].properties.Company + '</dt>' +'<dt>'+ e.features[0].properties.Type + '</dt>'+'<dt>')
.addTo(map);
});
// interacion fin bloquesar
// interacion inicio bloquesar
map.on('click', 'PRODUCTION', function (e) {
new mapboxgl.Popup()
.setLngLat(e.lngLat)
.setHTML('<dt>' + e.features[0].properties.Name + '</dt>'+'<dt>'+ e.features[0].properties.Company + '</dt>' +'<dt>'+ e.features[0].properties.Type + '</dt>'+'<dt>')
.addTo(map);
});
// interacion fin bloquesar
// interacion inicio NEWS2
map.on('click', 'NEWS', function (e) {
new mapboxgl.Popup()
.setLngLat(e.lngLat)
.setHTML('<dd>' + e.features[0].properties.name +
'<img src=" '+ e.features[0].properties.shareimage + '" />'
+ e.features[0].properties.html + '</dd>')
.addTo(map);
});
// interacion fin NEWS
// interacion inicio BID-ROUNDS
map.on('click', 'BID-ROUNDS', function (e) {
new mapboxgl.Popup()
.setLngLat(e.lngLat)
.setHTML('<dt>' + e.features[0].properties.title + '</dt>'+'<dt>'+ e.features[0].properties.description + '</dt>' )
.addTo(map);
});
// interacion fin bloquesar
// modal interaction
var modal = document.getElementById('aboutModal');
modal.style.display = "hide";
var span = document.getElementsByClassName("close")[0];
span.onclick = function() {
modal.style.display = "none";
}
var aboutHeader = document.getElementsByClassName("about-header")[0];
aboutHeader.onclick = function() {
document.body.style.cursor = "pointer";
modal.style.display = "block";
}
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none"; }
}
//geocder
var customData
function forwardGeocoder(query) {
var matchingFeatures = [];
for (var i = 0; i < customData.features.length; i++) {
var feature = customData.features[i];
// handle queries with different capitalization than the source data by calling toLowerCase()
if (
feature.properties.title
.toLowerCase()
.search(query.toLowerCase()) !== -1
) {
// add a tree emoji as a prefix for custom data results
// using carmen geojson format: https://github.com/mapbox/carmen/blob/master/carmen-geojson.md
feature['place_name'] = '🛢️ ' + feature.properties.title;
feature['center'] = feature.geometry.coordinates;
feature['place_type'] = ['park'];
matchingFeatures.push(feature);
}
}
return matchingFeatures;
}
map.addControl(
new MapboxGeocoder({
accessToken: mapboxgl.accessToken,
localGeocoder: forwardGeocoder,
zoom: 9,
placeholder: '🛢️ Enter Oil Block Name',
mapboxgl: mapboxgl
}) ,'bottom-right'
);
// to grab checkbox value
$('input.js-checkboxes').prop('checked', true);
var nav = new mapboxgl.NavigationControl();
var nav2 = new mapboxgl.FullscreenControl();
var nav3 = new mapboxgl.GeolocateControl({ positionOptions: { enableHighAccuracy: true }, trackUserLocation: true });
map.addControl(nav, 'bottom-right');
map.addControl(nav2, 'bottom-right');
map.addControl(nav3, 'bottom-right');
function mapReset() {
if (window.innerWidth < 800) {
map.setZoom(4.17);
} else {
map.setZoom(4.17);
}
}
var distanceContainer = document.getElementById("distance");
var distanceGuide = document.getElementById("distanceGuide");
//ruler
// Array to store id's of measured lines -- kinda irrelevant as we have a counter
var measureLayers = [];
var counter = 0;
var enabled = false;
// GeoJSON object to hold our measurement features
var geojson = {
type: "FeatureCollection",
features: []
};
// Used to draw a line between points
var linestring = {
type: "Feature",
geometry: {
type: "LineString",
coordinates: []
}
};
function measureDistance() {
// Step 1, Toggle
enabled = !enabled
// If disabled and source exists, remove it
if (enabled === false) {
// Check for map source
if (typeof map.getSource("geojson") === "object") {
// Delete map layers from geojson
map.removeLayer("measure-points");
map.removeLayer("measure-lines");
// Remove map source
map.removeSource("geojson");
// Remove the distance calculator
distanceContainer.innerHTML = "";
// Reset geojson
geojson = {
type: "FeatureCollection",
features: []
};
// Remove mouse handler
map.off("mousemove", measureMouseHandler);
// Remove onclick handler
map.off("click", measureDistanceHandler);
// Reset mouse cursor
map.getCanvas().style.cursor = "";
}
} else if (enabled === true) {
// Add data source
map.addSource("geojson", {
type: "geojson",
data: geojson
});
// Add styles to the map
map.addLayer({
id: "measure-points",
type: "circle",
source: "geojson",
paint: {
"circle-radius": 5,
"circle-color": "#ef5350"
},
filter: ["in", "$type", "Point"]
});
map.addLayer({
id: "measure-lines",
type: "line",
source: "geojson",
layout: {
"line-cap": "round",
"line-join": "round"
},
paint: {
"line-color": "#546e7a",
"line-width": 2.5
},
filter: ["in", "$type", "LineString"]
},
"measure-points"
);
// Add on click handler
map.on('click', measureDistanceHandler)
// UI indicator for clicking/hovering a point on the map
map.on("mousemove", measureMouseHandler)
}
};
function measureDistanceHandler(e) {
var features = map.queryRenderedFeatures(e.point, {
layers: ['measure-points']
});
// Remove the linestring from the group
// So we can redraw it based on the points collection
if (geojson.features.length > 1) geojson.features.pop();
// Clear the Distance container to populate it with a new value
distanceContainer.innerHTML = '';
// If a feature was clicked, remove it from the map
if (features.length) {
var id = features[0].properties.id;
geojson.features = geojson.features.filter(function (point) {
return point.properties.id !== id;
});
} else {
var point = {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
e.lngLat.lng,
e.lngLat.lat
]
},
"properties": {
"id": `measure-${counter}`
}
};
geojson.features.push(point);
counter++;
measureLayers.push(point.properties.id);
}
// If there's a line, calculate the distance
if (geojson.features.length > 1) {
linestring.geometry.coordinates = geojson.features.map(function (point) {
return point.geometry.coordinates;
});
geojson.features.push(linestring);
// Populate the distanceContainer with total distance
var value = document.createElement("pre");
// If total distance less than 1km display in metres
if (turf.lineDistance(linestring) < 1) {
let tDist = turf.lineDistance(linestring) * 1000;
value.textContent = "Total distance: " + tDist.toLocaleString() + "m";
distanceContainer.appendChild(value);
map.getSource("geojson").setData(geojson);
} else {
value.textContent =
"Total distance: " +
turf.lineDistance(linestring).toLocaleString() +
"km";
distanceContainer.appendChild(value);
map.getSource("geojson").setData(geojson);
}
}
// Sets new data, updates layers/source
map.getSource('geojson').setData(geojson);
};
function measureMouseHandler(e) {
var features = map.queryRenderedFeatures(e.point, {
layers: ["measure-points"]
});
map.getCanvas().style.cursor = features.length ? "pointer" : "crosshair";
};
</script>
<!-- start section cookies -->
</script><script src="./js/cookieconsent.min.js" data-cfasync="false"></script>
<script>
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#007afc"
},
"button": {
"background": "#fff",
"text": "#007afc"
}
},
"theme": "edgeless",
"position": "bottom-left",
"content": {
"message": "This website uses cookies to provide visitors with the best experience. Please see our <a target='_blank' style='color:white;' href='https://www.oilmap.xyz/legal/privacy-policy.html'>Privacy Policy</a> and <a target='_blank' style='color:white;' href='https://www.oilmap.xyz/legal/privacy-cookies.html'>Cookie Policy</a> for more information.",
"link": ""
}
});
window.cookieconsent.hasTransition = false;
window.expiryDays = 365;
</script>
<!--End Cookies-->
<!--Geocoder -->
<script src='https://api.mapbox.com/mapbox.js/plugins/turf/v2.0.2/turf.min.js'></script>
<script src="data/geocoder.js"></script>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@id": "https://www.oilmap.xyz",
"@type": "WebSite",
"url": "https://www.oilmap.xyz",
"name": "OilMap",
"potentialAction": {
"@type": "SearchAction",
"target": "https://cse.google.com/cse?cx=0d16527ec2825c2c0",
"query-input": "required name=search_term_string"
}
}
</script>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@id": "https://www.oilmap.xyz",
"@type": "WebPage",
"url": "https://www.oilmap.xyz/",
"name": "OilMap"
}
</script>
</body></html>
<!--Licensing information: https://roqueleal.me Purchase the pro version -->