-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.html
More file actions
1321 lines (1161 loc) · 53.7 KB
/
map.html
File metadata and controls
1321 lines (1161 loc) · 53.7 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
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
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- SEO Meta Tags -->
<title>Mapa Interativo Techno Sutra AR - Navegue pelo Dharma Virtual</title>
<meta name="description" content="Explore o mapa interativo dos 56 capítulos do Avatamsaka Sutra. Navegue pelo dharma virtual com visualizações em realidade aumentada e descubra os ensinamentos budistas de forma imersiva.">
<meta name="keywords" content="Avatamsaka Sutra, Mapa Interativo, Dharma Virtual, Budismo, Realidade Aumentada, AR, Navegação Espiritual, Techno Sutra, Meditação">
<meta name="author" content="Techno Sutra AR">
<meta name="robots" content="index, follow">
<meta name="language" content="Portuguese">
<meta name="revisit-after" content="7 days">
<meta name="theme-color" content="#7877c6">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://technosutra.com/map.html">
<meta property="og:title" content="Mapa Interativo Techno Sutra AR - Navegue pelo Dharma Virtual">
<meta property="og:description" content="Explore o mapa interativo dos 56 capítulos do Avatamsaka Sutra. Navegue pelo dharma virtual com visualizações em realidade aumentada.">
<meta property="og:image" content="https://technosutra.com/imgs/icon.png">
<meta property="og:site_name" content="Techno Sutra AR">
<meta property="og:locale" content="pt_BR">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://technosutra.com/map.html">
<meta property="twitter:title" content="Mapa Interativo Techno Sutra AR - Navegue pelo Dharma Virtual">
<meta property="twitter:description" content="Explore o mapa interativo dos 56 capítulos do Avatamsaka Sutra com visualizações em realidade aumentada.">
<meta property="twitter:image" content="https://technosutra.com/imgs/icon.png">
<!-- PWA Meta Tags -->
<link rel="manifest" href="manifest.json">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Techno Sutra AR">
<link rel="apple-touch-icon" href="/imgs/icon.png">
<!-- Favicon -->
<link rel="icon" type="image/png" href="/imgs/icon.png">
<link rel="shortcut icon" href="/imgs/icon.png">
<!-- Preload Critical Resources -->
<link rel="preload" href="https://unpkg.com/maplibre-gl@3.6.2/dist/maplibre-gl.css" as="style">
<link rel="preload" href="https://unpkg.com/maplibre-gl@3.6.2/dist/maplibre-gl.js" as="script">
<link href="https://unpkg.com/maplibre-gl@3.6.2/dist/maplibre-gl.css" rel="stylesheet" />
<style>
:root {
--neon-blue: #00f4ff;
--neon-purple: #bf40ff;
--neon-pink: #ff0080;
--neon-green: #00ff00;
--neon-red: #ff0040;
--neon-red-bright: #ff1155;
--cyber-dark: #000000;
--cyber-accent: #111111;
--amoled-bg: rgba(0, 0, 0, 0.95);
--amoled-border: rgba(0, 244, 255, 0.3);
--glass-bg: var(--amoled-bg);
--glass-border: var(--amoled-border);
}
* {
box-sizing: border-box;
}
body, html {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
font-family: 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
overflow: hidden;
background: var(--cyber-dark);
}
#map {
width: 100%;
height: 100%;
position: relative;
}
/* Modern Collapsible Menu */
.menu-container {
position: fixed;
top: 20px;
left: 20px;
z-index: 2000;
font-family: inherit;
}
.menu-toggle {
width: 50px;
height: 50px;
border-radius: 50%;
background: var(--cyber-dark);
border: 2px solid var(--neon-blue);
backdrop-filter: blur(20px);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 0 20px rgba(0, 244, 255, 0.4), 0 8px 32px rgba(0, 0, 0, 0.8);
}
.menu-toggle:hover {
transform: scale(1.05);
box-shadow: 0 12px 40px rgba(0, 244, 255, 0.3);
border-color: var(--neon-blue);
}
.menu-icon {
width: 24px;
height: 24px;
position: relative;
transform: rotate(0deg);
transition: 0.3s ease-in-out;
}
.menu-icon span {
display: block;
position: absolute;
height: 3px;
width: 100%;
background: var(--neon-blue);
border-radius: 9px;
opacity: 1;
left: 0;
transform: rotate(0deg);
transition: 0.25s ease-in-out;
box-shadow: 0 0 10px var(--neon-blue);
}
.menu-icon span:nth-child(1) { top: 0px; }
.menu-icon span:nth-child(2) { top: 8px; }
.menu-icon span:nth-child(3) { top: 16px; }
.menu-toggle.open .menu-icon span:nth-child(1) {
top: 8px;
transform: rotate(135deg);
}
.menu-toggle.open .menu-icon span:nth-child(2) {
opacity: 0;
left: -60px;
}
.menu-toggle.open .menu-icon span:nth-child(3) {
top: 8px;
transform: rotate(-135deg);
}
.menu-panel {
position: absolute;
top: 60px;
left: 0;
min-width: 280px;
background: var(--cyber-dark);
border: 2px solid var(--neon-blue);
border-radius: 16px;
backdrop-filter: blur(20px);
padding: 20px;
transform: translateY(-20px);
opacity: 0;
visibility: hidden;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 0 30px rgba(0, 244, 255, 0.5), 0 20px 60px rgba(0, 0, 0, 0.9);
}
.menu-panel.open {
transform: translateY(0);
opacity: 1;
visibility: visible;
}
.menu-section {
margin-bottom: 20px;
}
.menu-section:last-child {
margin-bottom: 0;
}
.menu-section h3 {
color: var(--neon-blue);
font-size: 14px;
font-weight: 600;
margin: 0 0 12px 0;
text-transform: uppercase;
letter-spacing: 0.5px;
text-shadow: 0 0 10px var(--neon-blue);
}
.menu-item {
display: flex;
align-items: center;
padding: 12px 16px;
margin: 6px 0;
background: rgba(0, 244, 255, 0.05);
border: 1px solid rgba(0, 244, 255, 0.2);
border-radius: 12px;
cursor: pointer;
transition: all 0.3s ease;
color: white;
font-size: 14px;
text-decoration: none;
}
.menu-item:hover {
background: rgba(0, 244, 255, 0.1);
border-color: var(--neon-blue);
transform: translateX(4px);
box-shadow: 0 4px 20px rgba(0, 244, 255, 0.2);
}
.menu-item .icon {
margin-right: 12px;
font-size: 16px;
}
.menu-item.active {
background: rgba(0, 244, 255, 0.2);
border-color: var(--neon-blue);
box-shadow: 0 0 20px rgba(0, 244, 255, 0.3);
}
.toggle-switch {
position: relative;
width: 50px;
height: 24px;
background: rgba(255, 255, 255, 0.1);
border-radius: 12px;
border: 1px solid rgba(255, 255, 255, 0.2);
cursor: pointer;
transition: all 0.3s ease;
}
.toggle-switch::before {
content: '';
position: absolute;
width: 18px;
height: 18px;
border-radius: 50%;
background: white;
top: 2px;
left: 2px;
transition: all 0.3s ease;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.toggle-switch.active {
background: var(--neon-blue);
border-color: var(--neon-blue);
box-shadow: 0 0 15px rgba(0, 244, 255, 0.5);
}
.toggle-switch.active::before {
left: 28px;
}
.toggle-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
margin: 6px 0;
background: rgba(0, 244, 255, 0.05);
border: 1px solid rgba(0, 244, 255, 0.2);
border-radius: 12px;
color: white;
font-size: 14px;
}
/* Enhanced Popups */
.maplibregl-popup {
max-width: 320px;
}
.maplibregl-popup-content {
background: var(--cyber-dark) !important;
border: 2px solid var(--neon-blue) !important;
border-radius: 16px !important;
backdrop-filter: blur(20px) !important;
box-shadow: 0 0 20px rgba(0, 244, 255, 0.4), 0 20px 60px rgba(0, 0, 0, 0.8) !important;
}
/* Popup action buttons */
.popup-actions {
display: flex;
gap: 8px;
margin-top: 12px;
justify-content: flex-end;
}
.popup-btn {
border: 1px solid rgba(255,255,255,0.08);
background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
color: white;
padding: 8px 10px;
border-radius: 12px;
font-weight: 600;
cursor: pointer;
font-size: 13px;
backdrop-filter: blur(6px);
transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.popup-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.5); }
.popup-btn.ar { background: linear-gradient(90deg, rgba(0,244,255,0.12), rgba(191,64,255,0.06)); border: 1px solid rgba(0,244,255,0.25); }
.popup-btn.qr { background: linear-gradient(90deg, rgba(255,0,128,0.06), rgba(0,0,0,0.02)); border: 1px solid rgba(255,0,128,0.18); }
.popup-content {
padding: 16px;
color: white;
}
.popup-title {
font-weight: 600;
margin-bottom: 8px;
color: var(--neon-blue);
font-size: 16px;
text-shadow: 0 0 10px var(--neon-blue);
}
.popup-location {
font-size: 12px;
color: rgba(255, 255, 255, 0.8);
line-height: 1.4;
margin-bottom: 8px;
}
.popup-coordinates {
font-size: 10px;
color: rgba(255, 255, 255, 0.6);
font-family: monospace;
}
/* Neon Waypoint Markers */
.waypoint-marker {
width: 24px;
height: 24px;
border-radius: 50%;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 10px;
font-weight: bold;
color: white;
text-shadow: 0 0 5px currentColor;
transition: all 0.3s ease;
transform-origin: center;
}
.waypoint-marker.part1 {
background: radial-gradient(circle, var(--neon-blue), transparent 70%);
border: 2px solid var(--neon-blue);
box-shadow: 0 0 15px var(--neon-blue), inset 0 0 15px rgba(0, 244, 255, 0.3);
}
.waypoint-marker.part2 {
background: radial-gradient(circle, var(--neon-purple), transparent 70%);
border: 2px solid var(--neon-purple);
box-shadow: 0 0 15px var(--neon-purple), inset 0 0 15px rgba(191, 64, 255, 0.3);
}
.waypoint-marker:hover {
transform: translate(-50%, -50%) scale(1.2);
z-index: 1000;
}
/* Size variations for markers */
.waypoint-marker.size-small {
width: 16px;
height: 16px;
font-size: 8px;
}
.waypoint-marker.size-medium {
width: 24px;
height: 24px;
font-size: 10px;
}
.waypoint-marker.size-large {
width: 32px;
height: 32px;
font-size: 12px;
}
.waypoint-marker.size-extra-large {
width: 40px;
height: 40px;
font-size: 14px;
}
.waypoint-marker::before {
content: '';
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
background: inherit;
opacity: 0.6;
animation: pulse-ring 2s infinite;
}
/* Enhanced User Marker */
.user-marker {
width: 24px;
height: 24px;
border-radius: 50%;
background: radial-gradient(circle, var(--neon-pink), transparent 70%);
border: 3px solid var(--neon-pink);
box-shadow: 0 0 20px var(--neon-pink), inset 0 0 15px rgba(255, 0, 128, 0.3);
position: relative;
}
.user-marker::before {
content: '';
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
background: var(--neon-pink);
opacity: 0.4;
animation: pulse-ring 1.5s infinite;
}
/* Hide default MapLibre icon for user marker */
.maplibregl-marker .user-marker + svg {
display: none !important;
}
/* More comprehensive hiding of default marker icons */
.maplibregl-marker svg {
display: none !important;
}
/* Ensure custom markers are visible */
.maplibregl-marker .user-marker,
.maplibregl-marker .waypoint-marker {
display: flex !important;
visibility: visible !important;
}
@keyframes pulse-ring {
0% {
transform: scale(1);
opacity: 0.6;
}
50% {
transform: scale(1.5);
opacity: 0.3;
}
100% {
transform: scale(2);
opacity: 0;
}
}
/* Theme specific styles */
body.light-theme {
--glass-bg: rgba(255, 255, 255, 0.9);
--glass-border: rgba(0, 0, 0, 0.1);
}
body.light-theme .menu-item,
body.light-theme .toggle-item,
body.light-theme .popup-content {
color: #333;
}
body.light-theme .popup-title {
color: var(--neon-blue);
}
body.light-theme .popup-location {
color: rgba(0, 0, 0, 0.7);
}
body.light-theme .popup-coordinates {
color: rgba(0, 0, 0, 0.5);
}
/* Mobile Bottom Navigation */
.mobile-nav {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: rgba(15, 15, 15, 0.95);
backdrop-filter: blur(20px);
border-top: 1px solid rgba(0, 244, 255, 0.3);
padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
z-index: 1000;
display: none;
}
.mobile-nav-container {
display: flex;
justify-content: space-around;
align-items: center;
max-width: 400px;
margin: 0 auto;
padding: 0 20px;
}
.mobile-nav-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
text-decoration: none;
color: #9ca3af;
transition: all 0.3s ease;
padding: 8px 12px;
border-radius: 12px;
min-width: 60px;
}
.mobile-nav-item:hover,
.mobile-nav-item.active {
color: var(--neon-blue);
background: rgba(0, 244, 255, 0.1);
transform: translateY(-2px);
}
.mobile-nav-icon {
font-size: 1.5rem;
margin-bottom: 2px;
}
.mobile-nav-label {
font-size: 0.7rem;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.05em;
}
.mobile-nav-item.center {
background: linear-gradient(135deg, rgba(0, 244, 255, 0.2) 0%, rgba(0, 244, 255, 0.1) 100%);
border: 1px solid rgba(0, 244, 255, 0.3);
color: #ffffff;
transform: scale(1.1);
}
.mobile-nav-item.center:hover {
background: linear-gradient(135deg, rgba(0, 244, 255, 0.3) 0%, rgba(0, 244, 255, 0.2) 100%);
border-color: rgba(0, 244, 255, 0.5);
transform: scale(1.15) translateY(-2px);
}
/* Desktop Back Button */
.desktop-back-btn {
position: fixed;
top: 2%;
left: 5%;
z-index: 2000;
background: var(--cyber-dark);
border: 2px solid var(--neon-blue);
color: var(--neon-blue);
padding: 12px 16px;
border-radius: 8px;
font-size: 0.9rem;
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
backdrop-filter: blur(20px);
display: flex;
align-items: center;
gap: 8px;
letter-spacing: 0.025em;
box-shadow: 0 0 20px rgba(0, 244, 255, 0.4), 0 8px 32px rgba(0, 0, 0, 0.8);
text-decoration: none;
text-shadow: 0 0 10px var(--neon-blue);
}
.desktop-back-btn:hover {
background: rgba(0, 244, 255, 0.1);
border-color: var(--neon-blue);
transform: translateY(-2px) scale(1.05);
box-shadow: 0 12px 40px rgba(0, 244, 255, 0.3);
color: #ffffff;
}
/* Hide back button on mobile */
@media (max-width: 768px) {
.desktop-back-btn {
display: none;
}
}
/* Responsive Design */
@media (max-width: 768px) {
.mobile-nav {
display: block;
}
body {
padding-bottom: 80px;
}
.menu-panel {
min-width: 260px;
left: -10px;
}
}
/* PWA safe area adjustments */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
.mobile-nav {
padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
}
</style>
<title>🌐 Techno Sutra Trail Map - Cyberpunk Edition</title>
</head>
<body>
<div id="map"></div>
<!-- QR Modal (hidden by default) -->
<div id="qrModal" style="display:none; position:fixed; z-index:3000; inset:0; align-items:center; justify-content:center;">
<div style="background:rgba(0,0,0,0.9); border:2px solid rgba(0,244,255,0.2); padding:18px; border-radius:14px; max-width:420px; width:90%; text-align:center;">
<div style="display:flex; justify-content:space-between; align-items:center; gap:12px;">
<div style="color:var(--neon-blue); font-weight:700;">QR Code</div>
<button id="qrCloseBtn" style="background:none; border:none; color:#fff; font-size:20px; cursor:pointer;">×</button>
</div>
<div style="margin-top:12px;">
<img id="qrImage" src="" alt="QR Code" style="max-width:100%; border-radius:8px; border:1px solid rgba(255,255,255,0.04);" />
</div>
<div style="margin-top:12px; display:flex; gap:8px; justify-content:center;">
<a id="qrDownload" href="#" download style="text-decoration:none;"><button class="popup-btn qr">⬇️ Download</button></a>
<button id="qrOpenNew" class="popup-btn" style="background:rgba(255,255,255,0.03);" onclick="openQRInNewTab()">🔎 Open</button>
</div>
</div>
</div>
<!-- Desktop Back Button -->
<a href="index.html" class="desktop-back-btn">
← Voltar
</a>
<div id="logo-container">
<img src="/imgs/icon.png" alt="TechnoSutra Logo" class="logo-image">
<img src="lobo-guar%C3%A1.jpg" alt="Lobo Guará" class="logo-image">
</div>
<!-- Modern Collapsible Menu -->
<div class="menu-container">
<div class="menu-toggle" onclick="toggleMenu()">
<div class="menu-icon">
<span></span>
<span></span>
<span></span>
</div>
</div>
<div class="menu-panel" id="menuPanel">
<div class="menu-section">
<h3>🎨 Map Style</h3>
<div class="menu-item" onclick="setMapStyle('cyberpunk')" id="cyberpunk-style">
<span class="icon">🌆</span>
<span>Cyberpunk</span>
</div>
<div class="menu-item active" onclick="setMapStyle('satellite')" id="satellite-style">
<span class="icon">🛰️</span>
<span>Satélite</span>
</div>
<div class="menu-item" onclick="setMapStyle('simple')" id="simple-style">
<span class="icon">🗺️</span>
<span>Simples</span>
</div>
</div>
<div class="menu-section">
<h3>🧭 The Trail</h3>
<div class="menu-item" onclick="locateUser()">
<span class="icon">📍</span>
<span>My Localization</span>
</div>
<div class="menu-item" onclick="zoomToTrail()">
<span class="icon">🎯</span>
<span>Complete Hiking</span>
</div>
</div>
</div>
</div>
<script src="https://unpkg.com/maplibre-gl@3.6.2/dist/maplibre-gl.js"></script>
<script>
// Dados da trilha com informações do trail.json
const trailData =
{
"1": { "lat": -21.868036707651, "lng": -46.67732383198648, "name": "Buda Śākyamuni", "location": "Jetavana, no parque de Anāthapiṇḍada em Śrāvastī" },
"2": { "lat": -21.86953296779599, "lng": -46.67805522448601, "name": "Samantabhadra", "location": "Jetavana, no parque de Anāthapiṇḍada em Śrāvastī" },
"3": { "lat": -21.87091546996187, "lng": -46.67797426313243, "name": "Manjushri", "location": "Dhanyākara e floresta sagrada de Vicitra sāla dhvaja vyūha" },
"4": { "lat": -21.87221986659534, "lng": -46.67824132815174, "name": "Meghaśrī", "location": "Montanha Sugrīva, na terra de Rāmāvarānta" },
"5": { "lat": -21.87309784586943, "lng": -46.67866035798463, "name": "Sāgaramegha", "location": "Costa do oceano, distrito de Sāgaramukha" },
"6": { "lat": -21.87393288759804, "lng": -46.67925395359822, "name": "Supratiṣṭhita", "location": "Sāgaratīra, na região de Laṅka" },
"7": { "lat": -21.87514572152676, "lng": -46.67896578739468, "name": "Megha", "location": "Cidade de Vajrapura, na terra de Draviḍa" },
"8": { "lat": -21.87619736973498, "lng": -46.67855933883119, "name": "Muktaka", "location": "Cidade de Vanavāsī" },
"9": { "lat": -21.87646251203698, "lng": -46.67736879037174, "name": "Sāgaradhvaja", "location": "Milaspharaṇa, ponta do continente de Jambudvīpa" },
"10": { "lat": -21.87646009570215, "lng": -46.67623116961117, "name": "Āśā", "location": "Parque Samantavyūha na cidade de Samudravetāḍī" },
"11": { "lat": -21.87726006988734, "lng": -46.6754990688399, "name": "Bhīṣmottaranirghoṣa", "location": "Floresta na terra de Nālayu" },
"12": { "lat": -21.87881053413763, "lng": -46.67500319464728, "name": "Jayoṣmāyatana", "location": "Terra de Īṣāṇa, entre montanha de fogo e penhasco" },
"13": { "lat": -21.88019054400148, "lng": -46.67496499173143, "name": "Maitrayaṇī", "location": "Palácio Vairocana-garbha na cidade de Siṃha-vijṛmbhita" },
"14": { "lat": -21.88187093491057, "lng": -46.67521163743071, "name": "Sudarśana", "location": "Densa floresta na terra de Trinayana" },
"15": { "lat": -21.88360463284878, "lng": -46.67525319610547, "name": "Indriyeśvara", "location": "Confluência de rios na cidade de Sumukha" },
"16": { "lat": -21.88554337763284, "lng": -46.67386659277159, "name": "Jayoṣmāyatana", "location": "Casa na cidade de Samudra-pratiṣṭhāna" },
"17": { "lat": -21.88804852246186, "lng": -46.67358940032627, "name": "Vidvān", "location": "Encruzilhada no centro de Mahāsaṃbhava" },
"18": { "lat": -21.89026427458782, "lng": -46.67236457977307, "name": "Sudarśana", "location": "Cidade de Siṃhapota, casa de dez andares" },
"19": { "lat": -21.89257575982119, "lng": -46.67372402528618, "name": "Samantanetra", "location": "Loja de perfumes em Samantamukha, terra de Vetramūlaka" },
"20": { "lat": -21.89565884155847, "lng": -46.67312906215643, "name": "Anala", "location": "Cidade de Tāladhvaja, sala do trono" },
"21": { "lat": -21.90046826241142, "lng": -46.67138193438598, "name": "Mahāprabha", "location": "Cidade de Suprabha, utopia de magnificência" },
"22": { "lat": -21.90531978305068, "lng": -46.67251368039676, "name": "Acalā", "location": "Cidade de Sthirā, casa dos pais" },
"23": { "lat": -21.9089395994778, "lng": -46.67338258043213, "name": "Sarvagamin", "location": "Topo da colina Sulabha, perto de Tosala" },
"24": { "lat": -21.91231515618248, "lng": -46.67015524085872, "name": "Utpalabhūti", "location": "Terra de Pṛthurāṣṭra" },
"25": { "lat": -21.91370861343965, "lng": -46.66815680928756, "name": "Vaira", "location": "Cidade costeira de Kūṭāgāra" },
"26": { "lat": -21.91747796051475, "lng": -46.66700692393895, "name": "Jayottama", "location": "Floresta Vicitra Dhvaja, cidade de Nandihāra" },
"27": { "lat": -21.92129874885887, "lng": -46.66574849523462, "name": "Siṃhavijṛmbhitā", "location": "Parque Sūrya Prabha, cidade de Kaliṅgavana" },
"28": { "lat": -21.92441500351332, "lng": -46.66505284033605, "name": "Vasumitrā", "location": "Cidade de Śubhaparaṃgama" },
"29": { "lat": -21.92638215736361, "lng": -46.66537976269724, "name": "Veṣṭhila", "location": "Cidade de Śubhapāraṃgama" },
"30": { "lat": -21.92872573943014, "lng": -46.67003972230864, "name": "Avalokiteśvara", "location": "Monte Potalaka, paraíso terrestre" },
"31": { "lat": -21.92801238471129, "lng": -46.67454405999145, "name": "Ananyagāmin", "location": "Pico de montanha do sistema de mundos Sahā" },
"32": { "lat": -21.92645798923365, "lng": -46.67815322914891, "name": "Mahādeva", "location": "Templo na encruzilhada da cidade de Dvāravatī" },
"33": { "lat": -21.92316358227298, "lng": -46.6791445469042, "name": "Sthāvarā", "location": "Bodhimaṇḍa na terra de Magadha" },
"34": { "lat": -21.92362359048531, "lng": -46.6842726229277, "name": "Vāsantī", "location": "Céu acima da cidade de Kapilavastu" },
"35": { "lat": -21.92525160262302, "lng": -46.6867179324565, "name": "Samantagambhīraśrīvimalaprabhā", "location": "Bodhimaṇḍa, terra de Magadha, próximo a Vāsantī" },
"36": { "lat": -21.9273497679517, "lng": -46.68749089829076, "name": "Pramuditanayanajagadvirocanā", "location": "Bodhimaṇḍa, assembleia do Buda" },
"37": { "lat": -21.9296471001546, "lng": -46.69039976309249, "name": "Samantasattvatrāṇojaḥśrī", "location": "No bodhimaṇḍa" },
"38": { "lat": -21.92897397421807, "lng": -46.69217665332104, "name": "Praśantarutasāgaravatī", "location": "No bodhimaṇḍa" },
"39": { "lat": -21.93158183370527, "lng": -46.69375654414417, "name": "Sarvanagararakṣāsaṃbhavatejaḥśrī", "location": "Trono de lótus com séquito de deusas" },
"40": { "lat": -21.93423405856974, "lng": -46.69338262520748, "name": "Sarvavṛkṣpraphullanasukhasaṃvāsā", "location": "Kūṭāgāra de árvores preciosas" },
"41": { "lat": -21.93558462766117, "lng": -46.69382309551595, "name": "Sarvajagadrakṣāpraṇidhānavīryaprabhā", "location": "Bodhimaṇḍa, meio do séquito" },
"42": { "lat": -21.93567267136837, "lng": -46.6939274554807, "name": "Sutejomaṇḍalaratiśrī", "location": "Floresta de Lumbinī, local de nascimento do Buda" },
"43": { "lat": -21.93582378796983, "lng": -46.69400128111388, "name": "Gopā", "location": "Salão de assembleia dos bodhisattvas, Kapilavastu" },
"44": { "lat": -21.945875, "lng": -46.72265833333334, "name": "Māyādevī", "location": "Kūṭāgāra miraculoso em grande lótus de joias" },
"45": { "lat": -21.94576185804032, "lng": -46.72279111267893, "name": "Surendrābhā", "location": "Paraíso de Trāyastriṃśa (céu dos 33 deuses)" },
"46": { "lat": -21.9458126872239, "lng": -46.72271692853997, "name": "Viśvāmitra", "location": "Cidade de Kapilavastu" },
"47": { "lat": -21.94570944120324, "lng": -46.72285742172848, "name": "Śilpābhijña", "location": "Após falar com Viśvāmitra" },
"48": { "lat": -21.94566634811362, "lng": -46.72291440447311, "name": "Bhadrottamā", "location": "Cidade de Vartanaka, região de Kevalaka" },
"49": { "lat": -21.94561390616393, "lng": -46.72297119284677, "name": "Muktāsāra", "location": "Cidade de Bharukaccha, região sul" },
"50": { "lat": -21.9455701207428, "lng": -46.72301867573663, "name": "Sucandra", "location": "Floresta ao lado da cidade de Bharukaccha" },
"51": { "lat": -21.94554168699781, "lng": -46.72306759875011, "name": "Ajitasena", "location": "Cidade de Roruka, região sul" },
"52": { "lat": -21.94550541436743, "lng": -46.72312550616623, "name": "Śivarāgra", "location": "Vila chamada Dharma, região sul" },
"53": { "lat": -21.94578734327873, "lng": -46.72274673868932, "name": "Śrīsaṃbhava & Śrīmati", "location": "Cidade de Sumanāmukha, região sul" },
"54": { "lat": -21.94585287592502, "lng": -46.72269285931593, "name": "Maitreya", "location": "Grande pavilhão Vairocana-vyūhālaṃkāra-garbha" },
"55": { "lat": -21.9457395226932, "lng": -46.72281764935126, "name": "Manjushri", "location": "Cidade de Sumanāmukha, 110 yojanas de distância" },
"56": { "lat": -21.9457395226932, "lng": -46.72281764935126, "name": "Samantabhadra", "location": "Bodhimaṇḍa, diante do Tathāgata Vairocana" }
}
// Converter dados da trilha para array
const waypoints = Object.entries(trailData).map(([id, point]) => ({
id: parseInt(id),
...point
}));
// Apply class for trail part markers
waypoints.forEach((point) => {
point.part = point.id <= 43 ? 'part1' : 'part2';
});
// Estilos de mapa com suporte completo
const mapStyles = {
cyberpunk: {
name: 'Cyberpunk',
style: {
"version": 8,
"sources": {
"terrain": {
"type": "raster",
"tiles": ["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],
"tileSize": 256,
"attribution": "© OpenStreetMap contributors"
}
},
"layers": [{
"id": "terrain",
"type": "raster",
"source": "terrain",
"paint": {
"raster-opacity": 0.8,
"raster-hue-rotate": 200,
"raster-saturation": -0.5,
"raster-brightness-min": 0,
"raster-brightness-max": 0.2,
"raster-contrast": 0.7
}
}],
"glyphs": "https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"
}
},
satellite: {
name: 'Satélite',
style: {
"version": 8,
"sources": {
"satellite": {
"type": "raster",
"tiles": ["https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}"],
"tileSize": 256,
"attribution": "© Google Satellite"
}
},
"layers": [{
"id": "satellite",
"type": "raster",
"source": "satellite"
}]
}
},
simple: {
name: 'Simples',
style: {
"version": 8,
"sources": {
"osm": {
"type": "raster",
"tiles": ["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],
"tileSize": 256,
"attribution": "© OpenStreetMap contributors"
}
},
"layers": [{
"id": "osm",
"type": "raster",
"source": "osm"
}]
}
},
};
let currentStyle = 'satellite';
let currentMarkerSize = 'medium';
let userMarker = null;
let watchId = null;
// Configurações de alta precisão para geolocalização
const highAccuracyOptions = {
enableHighAccuracy: true, // Usar GPS quando disponível
timeout: 15000, // 15 segundos para obter posição inicial
maximumAge: 10000 // Aceitar posição de até 10 segundos atrás
};
const trackingOptions = {
enableHighAccuracy: true, // Manter GPS ativo para rastreamento
timeout: 8000, // 8 segundos para atualizações
maximumAge: 15000 // Aceitar posição de até 15 segundos atrás
};
// Inicializar o mapa com vista satélite
const map = new maplibregl.Map({
container: 'map',
style: mapStyles.satellite.style,
center: [-46.69, -21.91], // Centro aproximado da trilha
zoom: 13,
pitch: 0,
bearing: 0
});
// Adicionar controles de navegação
map.addControl(new maplibregl.NavigationControl(), 'top-right');
map.addControl(new maplibregl.ScaleControl(), 'bottom-right');
// Funções de controle
function toggleMapStyle() {
const styleBtn = document.getElementById('styleBtn');
const styles = Object.keys(mapStyles);
const currentIndex = styles.indexOf(currentStyle);
const nextIndex = (currentIndex + 1) % styles.length;
currentStyle = styles[nextIndex];
map.setStyle(mapStyles[currentStyle].style);
const icons = { street: '🗺️', satellite: '📡', hybrid: '🌍' };
styleBtn.innerHTML = `${icons[currentStyle]} ${mapStyles[currentStyle].name}`;
// Re-adicionar as camadas após mudança de estilo
map.once('styledata', () => {
addTrailLayers();
});
}
function zoomToTrail() {
const bounds = new maplibregl.LngLatBounds();
waypoints.forEach(point => {
bounds.extend([point.lng, point.lat]);
});
map.fitBounds(bounds, { padding: 50 });
}
function locateUser() {
if (!navigator.geolocation) {
alert('Geolocalização não é suportada neste navegador.');
return;
}
// Mostrar mensagem de carregamento
const btn = document.querySelector('[onclick="locateUser()"]');
const originalText = btn.innerHTML;
btn.innerHTML = '🔄 Localizando...';
btn.disabled = true;
navigator.geolocation.getCurrentPosition(
(position) => {
const userLocation = [position.coords.longitude, position.coords.latitude];
const accuracy = position.coords.accuracy;
console.log(`Localização obtida com precisão de ${accuracy} metros`);
// Remover marcador anterior se existir
if (userMarker) {
userMarker.remove();
}
// Criar elemento customizado para o marcador do usuário
const userMarkerEl = document.createElement('div');
userMarkerEl.className = 'user-marker';
userMarker = new maplibregl.Marker(userMarkerEl)
.setLngLat(userLocation)
.setPopup(new maplibregl.Popup().setHTML(
`<div class="popup-content">
<div class="popup-title">📍 Você está aqui</div>
<div style="font-size: 10px; color: #666; margin-top: 4px;">
Precisão: ~${Math.round(accuracy)}m
</div>
</div>`
))
.addTo(map);
map.flyTo({ center: userLocation, zoom: 17 });
// Iniciar rastreamento contínuo
if (watchId) {
navigator.geolocation.clearWatch(watchId);
}
watchId = navigator.geolocation.watchPosition(
(position) => {
const newLocation = [position.coords.longitude, position.coords.latitude];
if (userMarker) {
userMarker.setLngLat(newLocation);
// Atualizar popup com nova precisão
const newAccuracy = position.coords.accuracy;
userMarker.setPopup(new maplibregl.Popup().setHTML(
`<div class="popup-content">
<div class="popup-title">📍 Você está aqui</div>
<div style="font-size: 10px; color: #666; margin-top: 4px;">
Precisão: ~${Math.round(newAccuracy)}m
</div>
</div>`
));
}
},
(error) => {
console.warn('Erro no rastreamento:', error);
// Tentar novamente com configurações menos restritivas se falhar
if (error.code === 3) { // TIMEOUT
navigator.geolocation.watchPosition(
(position) => {
const newLocation = [position.coords.longitude, position.coords.latitude];
if (userMarker) {
userMarker.setLngLat(newLocation);
}
},
() => {}, // Silenciar erros subsequentes
{ enableHighAccuracy: false, maximumAge: 30000, timeout: 15000 }
);
}
},
trackingOptions
);
// Restaurar botão
btn.innerHTML = originalText;
btn.disabled = false;
},
(error) => {
console.error('Erro de geolocalização:', error);
let errorMessage = 'Erro ao obter localização: ';
switch(error.code) {
case 1: // PERMISSION_DENIED
errorMessage += 'Permissão negada. Verifique as configurações do navegador.';
break;
case 2: // POSITION_UNAVAILABLE
errorMessage += 'Posição indisponível. Tente novamente.';
break;
case 3: // TIMEOUT