forked from Xueimuohtreb/Plan-interactif-Rennes-2
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Prototype.html
2647 lines (2510 loc) · 120 KB
/
Prototype.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
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="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Prototype Mapbox GL</title>
<style>
html, body{overflow:hidden;}
.loader{
background-color : white;cursor: wait;height: 100%;left: 0;position: fixed;top: 0;width: 100%;z-index: 999999;
}
#loader-img{
position:absolute;left: 50%;top: 50%;width: 30px;height: 30px;margin-left: -15px; margin-top: -15px;
}
.loader h1{
position : absolute;background: none;border: none;color: #45739B;font-size: 15px;top:60%;left : 50%;font-family: "Open Sans",sans-serif;font-variant: small-caps;font-weight: 700;height: 30px;width: 200px;margin-top : -15px;margin-left : -100px;text-align: center;
}
</style>
<!-- API MAPBOX GL-->
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.0/mapbox-gl.css' rel='stylesheet' />
<!-- CHARGEMENT DES FEUILLES DE STYLE CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet"> <!-- TEMPLATE -->
<link href="css/startmin.css" rel="stylesheet"> <!-- FEUILLE DE STYLE PERSO -->
<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css"> <!-- AJOUT DES FLECHES MENU -->
<link rel="stylesheet" href="EasyAutocomplete-1.3.5/easy-autocomplete.min.css"> <!-- BARRE DE RECHERCHE -->
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- MAPBOX GL -->
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.0/mapbox-gl.js'></script>
<!-- JQUERY -->
<script src="https://code.jquery.com/jquery-1.11.2.js" integrity="sha256-WMJwNbei5YnfOX5dfgVCS5C4waqvc+/0fV7W2uy3DyU=" crossorigin="anonymous"></script>
<!-- library for search box -->
<script src= "EasyAutocomplete-1.3.5/jquery.easy-autocomplete.min.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!-- Metis Menu Plugin JavaScript -->
<script src="js/metisMenu.min.js"></script>
<!-- Custom Theme JavaScript -->
<script src="js/startmin.js"></script>
<!-- LOADER -->
<div class = "loader"><center><img id = "loader-img" src = 'css/ajax-loader.gif'><h1>Chargement de la page</h1></center></div>
<div id="wrapper">
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation" >
<!-- Gestion du menu de couches -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Sidebar -->
<div class="navbar-default sidebar" role="navigation">
<div class="sidebar-nav navbar-collapse">
<!-- Search bar -->
<ul class="nav" id="side-menu">
<li class="sidebar-search">
<div id = "searchFieldContainer" class="input-group custom-search-form">
<input id= "searchfield" type="text" placeholder="Rechercher..." onkeypress="return runScriptKey(event)">
<span class="input-group-btn">
<button class="btn btn-primary" id = "searchButton" type="button" onclick = "return runScriptClic(event)">
<i class="fa fa-search" ></i>
</button>
</span>
</div>
</li>
<!-- Gestion des couches -->
<li>
<a href="#">Amphis et salles spécifiques <img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/amphitheatre.png"/><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li id = "Amphithéâtre">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#">Amphithéâtres</a>
</li>
<li id = "Salles informatique">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#">Salles informatique</a>
</li>
<li >
<a id = "Salles spécifiques" href="#"><img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "caseB">Salles spécifiques<span class="fa arrow"></span></a>
<ul class="nav nav-third-level" id = "insertSallesSpecifiques"></ul>
</li>
</ul>
</li>
<li>
<a href="#">Structures et services <img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/service.png"/><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li >
<a id = "Services centraux" href="#"><img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "caseB">Services centraux<span class="fa arrow"></span></a>
<ul class="nav nav-third-level" id = "insertServicescen"></ul>
</li>
<li >
<a id = "Services généraux" href="#"><img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "caseB">Services généraux<span class="fa arrow"></span></a>
<ul class="nav nav-third-level" id = "insertServicesgen"></ul>
</li>
<li >
<a id = "Services commun" href="#"><img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "caseB">Services commun<span class="fa arrow"></span></a>
<ul class="nav nav-third-level" id = "insertServicescom"></ul>
</li>
</ul>
</li>
<li>
<a href="#">Formation <img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/scolarites.png"/><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li >
<a id = "Formation UFRL" href="#"><img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "caseB">UFR Langues<span class="fa arrow"></span></a>
<ul class="nav nav-third-level" id = "insertFUFRL"></ul>
</li>
<li >
<a id = "Formation UFRSH" href="#"><img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "caseB">UFR Sciences Humaines<span class="fa arrow"></span></a>
<ul class="nav nav-third-level" id = "insertFUFRSH"></ul>
</li>
<li >
<a id = "Formation UFRSS" href="#"><img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "caseB">UFR Sciences Sociales<span class="fa arrow"></span></a>
<ul class="nav nav-third-level" id = "insertFUFRSS"></ul>
</li>
<li >
<a id = "Formation UFRSTAPS" href="#"><img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "caseB">UFR STAPS<span class="fa arrow"></span></a>
<ul class="nav nav-third-level" id = "insertFUFRSTAPS"></ul>
</li>
<li >
<a id = "Formation UFRALC" href="#"><img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "caseB">UFR ALC<span class="fa arrow"></span></a>
<ul class="nav nav-third-level" id = "insertFUFRALC"></ul>
</li>
</ul>
</li>
<li>
<a href="#">Recherche <img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/divers.png"/><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li >
<a id = "Recherche UFRL" href="#"><img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "caseB">UFR Langues<span class="fa arrow"></span></a>
<ul class="nav nav-third-level" id = "insertRUFRL"></ul>
</li>
<li >
<a id = "Recherche UFRSH" href="#"><img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "caseB">UFR Sciences Humaines<span class="fa arrow"></span></a>
<ul class="nav nav-third-level" id = "insertRUFRSH"></ul>
</li>
<li >
<a id = "Recherche UFRSS" href="#"><img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "caseB">UFR Sciences Sociales<span class="fa arrow"></span></a>
<ul class="nav nav-third-level" id = "insertRUFRSS"></ul>
</li>
<li >
<a id = "Recherche UFRSTAPS" href="#"><img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "caseB">UFR STAPS<span class="fa arrow"></span></a>
<ul class="nav nav-third-level" id = "insertRUFRSTAPS"></ul>
</li>
<li >
<a id = "Recherche UFRALC" href="#"><img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "caseB">UFR ALC<span class="fa arrow"></span></a>
<ul class="nav nav-third-level" id = "insertRUFRALC"></ul>
</li>
</ul>
</li>
<li>
<a href="#">Bibliothèques et Culture<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/biblio.png"/><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li id = "Bibliothèques">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#">Bibliothèques</a>
</li>
<li>
<a id = "Lieu culturel" href="#"><img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "caseB">Lieu culturel<span class="fa arrow"></span></a>
<ul class="nav nav-third-level" id = "insertLieuCulturel"></ul>
</li>
</ul>
</li>
<li>
<a href="#">Restauration et logement<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/restos.png"/><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li id = "Restaurants universitaires">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Restaurants universitaires</a>
</li>
<li id = "Caféterias">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Caféterias</a>
</li>
<li id = "Résidences universitaires">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Résidences universitaires</a>
</li>
</ul>
</li>
<li>
<a href="#">Sport et santé<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/sport.png"/><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li id = "Equipements sportifs">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Equipements sportifs</a>
</li>
<li id = "Pole santé">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Pole santé</a>
</li>
</ul>
</li>
<li>
<a href="#">Vie associative<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/asso.png"/><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li id = "Associations de filières">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#">Associations de filières</a>
</li>
<li id = "Associations de Masters et Doctorats">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Associations de Masters et Doctorats</a>
</li>
<li id = "Associations culturelles, artistiques et sportives">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Associations culturelles, artistiques et sportives</a>
</li>
<li id = "Associations de solidarité et de sensibilisation">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Associations de solidarité et de sensibilisation</a>
</li>
<li id = "Associations briochines">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Associations briochines (Campus Mazier)</a>
</li>
<li id = "Autres">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Autres</a>
</li>
</ul>
</li>
<li>
<a href="#">Divers<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/diverse.png"/><span class="fa arrow"></span></a>
<ul class="nav nav-second-level" >
<li id = "Toilettes">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Toilettes</a>
</li>
<li id = "Copieurs">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Copieurs</a>
</li>
<li id = "Espace détente">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Espace détente</a>
</li>
</ul>
</li>
<li>
<a href="#">Mobilités et accessibilité<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/mobilite.png"/><span class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a href="#">Se déplacer sur le campus <span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li id= "Ascenseurs">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Ascenseurs</a>
</li>
<li id = "Cheminements accessibles">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Cheminements accessibles</a>
</li>
</ul>
</li>
<li>
<a href="#">Accéder au campus <span class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li id = "Réseau de bus">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Réseau de bus</a>
</li>
<li id = "Métro">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Métro</a>
</li>
<li id = "Parkings vélo">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Parkings vélo</a>
</li>
<li id = "Stations vélostar">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Stations vélostar</a>
</li>
<li id = "Parkings">
<img src = "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png" class = "case"><a href="#" >Parkings voiture</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<div id="page-wrapper" style = "padding:0">
<div class="container-fluid" style = "padding-left:0;padding-right:0;padding-top : 0;padding-bottom : 0;margin-right: 0;margin-top : 0;margin-left: :0;margin-bottom : 0">
<div class="row">
<div class="col-lg-12"></div>
</div>
<div id="map" style="position:relative;margin-top:50px;margin-right:0;margin-left:0;margin-bottom:0;padding-right : 0;padding-left : 0; padding-top:0;padding-bottom:0;z-index:1;height:90vh">
<div id="DDD" class="btn-group">
</div>
<div id="campus" class="btn-group">
<button class="btn btn-primary" id="Villejean">Villejean</button>
<button class="btn btn-primary" id="LaHarpe">La Harpe</button>
<button class="btn btn-primary" id="Mazier">Saint Brieuc</button>
</div>
</div>
</div>
</div>
</div>
<script>
////////////////////////////////////// Récupération des variables URL //////////////////////////////////
function getQueryStringValue (key) {
return decodeURIComponent(window.location.search.replace(new RegExp("^(?:.*[&\\?]" + encodeURIComponent(key).replace(/[\.\+\*]/g, "\\$&") + "(?:\\=([^&]*))?)?.*$", "i"), "$1"));
}
var overlay = getQueryStringValue("layer").toString();
var overlayPoint = getQueryStringValue("point").toString();
/////////////////////////////////////// Initialisation du fond de carte //////////////////////////////////
// Adapter le zoom, et la largeur / placement des raccourcis spatiaux en fonction de l'écran
var device = null;
var largeurEcran = screen.width
var zoomBase = 15.8;
var BoutonsD = document.getElementById("DDD")
var Bouton2D = document.createElement('button');
Bouton2D.setAttribute("class","btn btn-primary");
Bouton2D.setAttribute("id","DDButton");
Bouton2D.innerHTML = '2D';
var Bouton3D = document.createElement('button');
Bouton3D.setAttribute("class","btn btn-primary");
Bouton3D.setAttribute("id","DDDButton");
Bouton3D.innerHTML = '3D';
if (largeurEcran < 500){
device = 'phone';
document.getElementById('map').style.height = '80vh';
zoomBase = 14.8;
BoutonsD.style.position = 'absolute';
BoutonsD.style.height = '50px';
BoutonsD.style.width = '100px';
BoutonsD.style.top = '95%';
BoutonsD.style.left = '50%';
BoutonsD.style.marginTop = '-25px';
BoutonsD.style.marginLeft = '-50px';
BoutonsD.appendChild(Bouton2D);
BoutonsD.appendChild(Bouton3D);
} else {
BoutonsD.appendChild(Bouton2D);
BoutonsD.appendChild(Bouton3D);
}
if (largeurEcran > 1000) {https://github.com/Xueimuohtreb/Plan-interactif/upload/master/icons/iconfond
document.getElementById('campus').style.width = '40%';
document.getElementById('Villejean').style.width= '33%';
document.getElementById('LaHarpe').style.width= '33%';
document.getElementById('Mazier').style.width= '33%';
document.getElementById('campus').style.marginLeft= '-20%';
}
//Limites de vue en fonction du campus visité
//Villejean / La Harpe
var rennesBounds = [
[-1.787293,48.067191 ], // Southwest coordinates
[-1.525772,48.169255 ] // Northeast coordinates
];
//Mazier
var mazierBounds = [
[-2.810090, 48.488519],
[-2.668165,48.534886]
];
// Appel du fond de carte
var map = new mapboxgl.Map({
container: 'map', // container id
style: 'https://free.tilehosting.com/styles/basic/style.json?key=nWBK7ixdxgsIG534xdet', // stylesheet location
center: [ -1.7015402487767233, 48.11941846173602], // starting position [lng, lat]
zoom: zoomBase,
minZoom:13, // zoom minimal
pitch : 0, // inclinaison de base
maxBounds: rennesBounds,
attributionControl : false // starting zoom
});
map.dragRotate.disable(); // vue 2D de base
/////////////////////////////////////// initialisation des variables overlay //////////////////////////////////
var case1 = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case1.png'; // Lien vers l'image case non cochée
var case2 = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/case2.png'; // Lien vers l'image case cochée
// Taille overlay:
var tailleMarker = [1,13,0.1,25,1.5]; // taille adaptative des éléments type marker /!\ NE PAS MODIFIER : pour toute modification de taille, changer la taille du .png
var taillePetitMarker = [1,13,0.05,25,1] // taille adaptative des éléments type marker /!\ NE PAS MODIFIER : pour toute modification de taille, changer la taille du .png
var tailleLine = [1.5,13,2,22,18]; // taille des éléments type ligne
var taillePoint = [1.5,13,2,22,60]; // taille adaptative des éléments type point
var taillePicto = [1.5,13,0.25,22,1.7]; // taille adaptative des éléments type pictogramme
var Etiquette = []; // Liste des couches ayant des étiquettes (exemple amphithéâtres)
var activeLayerBackground = '#EEEEEE' // couleur du background des lignes
/////////////// VARIABLES COUCHES ////////////////////
// Couche amphithéâtres
var amphiCount = 0; // initialisation du compteur
var amphitheatresLink = document.getElementById('Amphithéâtre'); // Recherche de la balise html liée à la couche
Etiquette.push('Amphithéâtre'); // Ajout des etiquettes
var amphiURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/amphi_marker.png';
// Couche salles informatique
var sallesInfoCount = 0;
var sallesInfoLink = document.getElementById('Salles informatique');
var sallesInfoURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/salle_info_marker.png';
// Couche salles spécifiques
var sallesSpeCount = 0;
var listeSallesSpecifiques = []; // Création dynamique de la liste des salles à partir du jeu de données
var sallesSpecifiquesLink = document.getElementById('Salles spécifiques');
var insertSallesSpecifiques = document.getElementById('insertSallesSpecifiques');
var sallesSpeURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/sallespe_marker.png' ;
// Services centraux
var ServicescenCount = 0;
var listeServicescen= []; // Création dynamique de la liste des salles à partir du jeu de données
var ServicescenLink = document.getElementById('Services centraux');
var insertServicescen = document.getElementById('insertServicescen');
var ServicescenURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/servicescen_marker.png';
// Services commun
var ServicescomCount = 0;
var listeServicescom = []; // Création dynamique de la liste des salles à partir du jeu de données
var ServicescomLink = document.getElementById('Services commun');
var insertServicescom = document.getElementById('insertServicescom');
var ServicescomURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/servicescom_marker.png';
// Services généraux
var ServicesgenCount = 0;
var listeServicesgen = []; // Création dynamique de la liste des salles à partir du jeu de données
var ServicesgenLink = document.getElementById('Services généraux');
var insertServicesgen = document.getElementById('insertServicesgen');
var ServicesgenURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/servicesgen_marker.png';
//formations
// Formation UFR Sciences Humaines
var FUFRSHCount = 0;
var listeFUFRSH = [];
var FUFRSHLink = document.getElementById('Formation UFRSH');
var insertFUFRSH = document.getElementById('insertFUFRSH');
var FUFRSHURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/formation_marker.png';
// Formation UFR Langue
var FUFRLCount = 0;
var listeFUFRL = [];
var FUFRLLink = document.getElementById('Formation UFRL');
var insertFUFRL = document.getElementById('insertFUFRL');
var FUFRLURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/formation_marker.png';
// Formation UFR Sciences Sociales
var FUFRSSCount = 0;
var listeFUFRSS = [];
var FUFRSSLink = document.getElementById('Formation UFRSS');
var insertFUFRSS = document.getElementById('insertFUFRSS');
var FUFRSSURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/formation_marker.png';
// Formation UFR STAPS
var FUFRSTAPSCount = 0;
var listeFUFRSTAPS = [];
var FUFRSTAPSLink = document.getElementById('Formation UFRSTAPS');
var insertFUFRSTAPS = document.getElementById('insertFUFRSTAPS');
var FUFRSTAPSURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/formation_marker.png';
// Formation UFR ALC
var FUFRALCCount = 0;
var listeFUFRALC = [];
var FUFRALCLink = document.getElementById('Formation UFRALC');
var insertFUFRALC = document.getElementById('insertFUFRALC');
var FUFRALCURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/formation_marker.png';
// recherche
// Recherche UFR Sciences Sociales
var RUFRSSCount = 0;
var listeRUFRSS = [];
var RUFRSSLink = document.getElementById('Recherche UFRSS');
var insertRUFRSS = document.getElementById('insertRUFRSS');
var RUFRSSURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/recherche_marker.png';
// Recherche UFR STAPS
var RUFRSTAPSCount = 0;
var listeRUFRSTAPS = [];
var RUFRSTAPSLink = document.getElementById('Recherche UFRSTAPS');
var insertRUFRSTAPS = document.getElementById('insertRUFRSTAPS');
var RUFRSTAPSURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/recherche_marker.png';
// Recherche UFR ALC
var RUFRALCCount = 0;
var listeRUFRALC = [];
var RUFRALCLink = document.getElementById('Recherche UFRALC');
var insertRUFRALC = document.getElementById('insertRUFRALC');
var RUFRALCURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/recherche_marker.png';
// Recherche UFR Langue
var RUFRLCount = 0;
var listeRUFRL = [];
var RUFRLLink = document.getElementById('Recherche UFRL');
var insertRUFRL = document.getElementById('insertRUFRL');
var RUFRLURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/recherche_marker.png';
// Recherche UFR Sciences Humaines
var RUFRSHCount = 0;
var listeRUFRSH = [];
var RUFRSHLink = document.getElementById('Recherche UFRSH');
var insertRUFRSH = document.getElementById('insertRUFRSH');
var RUFRSHURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/recherche_marker.png';
// Couche bibliothèques
var bibliothequesCount = 0; // initialisation du compteur de clics
var bibliothequesLink = document.getElementById("Bibliothèques");
var bibliothequesURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/biblio_marker.png';
// Couche Lieu culturel
var lieuCulturelCount = 0; // initialisation du compteur de clics
var lieuCulturelLink = document.getElementById('Lieu culturel');
var listelieuCulturel = []; // Création dynamique de la liste des salles à partir du jeu de données
var insertLieuCulturel = document.getElementById('insertLieuCulturel');
var lieuCulturelURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/culture_marker.png';
// Couche équipements sportifs
var equipementSportifCount = 0; // initialisation du compteur de clics
var equipementSportifLink = document.getElementById('Equipements sportifs');
var equipementSportifURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/sport_marker.png';
// Couche toilettes
var toilettesCount = 0; // initialisation du compteur de clics
var toilettesLink = document.getElementById('Toilettes');
var toilettesURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/wc_marker.png';
// Couche copieurs
var copieurCount = 0; // initialisation du compteur de clics
var copieurLink = document.getElementById('Copieurs');
var copieursURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/copieur_marker.png';
// Couche espace détente
var espaceDetenteCount = 0; // initialisation du compteur de clics
var espaceDetenteLink = document.getElementById('Espace détente');
var espaceDetenteURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/espacedetente_marker.png';
// Couche cafeterias
var cafeteriasCount = 0; // initialisation du compteur de clics
var cafeteriasLink = document.getElementById('Caféterias');
var cafeteriasURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/cafeteria_marker.png';
// Couche Résidences universitaires
var resUnivCount = 0; // initialisation du compteur de clics
var resUnivLink = document.getElementById("Résidences universitaires");
var resUnivURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/resuniv_marker.png';
// Couche Restaurants universitaires
var restoUnivCount = 0; // initialisation du compteur de clics
var restoUnivLink = document.getElementById("Restaurants universitaires");
var restoUnivURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/restauu_marker.png';
// Couche Associations de filières
var associationsfilieresCount = 0; // initialisation du compteur de clics
var associationsfilieresLink = document.getElementById('Associations de filières');
var associationsfilieresURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/association_marker.png';
// Couche Associations de Masters et Doctorats
var associationsmasterCount = 0; // initialisation du compteur de clics
var associationsmasterLink = document.getElementById('Associations de Masters et Doctorats');
var associationsmasterURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/association_marker2.png';
// Couche Associations briochines
var associationsbriochinesCount = 0; // initialisation du compteur de clics
var associationsbriochinesLink = document.getElementById('Associations briochines');
var associationsbriochinesURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/association_marker3.png';
// Couche Associations culturelles, artistiques et sportives
var associationscasCount = 0; // initialisation du compteur de clics
var associationscasLink = document.getElementById('Associations culturelles, artistiques et sportives');
var associationscasURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/association_marker4.png';
// Couche Associations de solidarité et de sensibilisation
var associationssolidariteCount = 0; // initialisation du compteur de clics
var associationssolidariteLink = document.getElementById('Associations de solidarité et de sensibilisation');
var associationssolidariteURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/association_marker5.png';
// Couche Associations autres
var associationsCount = 0; // initialisation du compteur de clics
var associationsLink = document.getElementById('Autres');
var associationsURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/association_marker6.png';
// Couche ascenseur
var ascenseurCount = 0; // initialisation du compteur de clics
var ascenseurLink = document.getElementById('Ascenseurs');
var ascenseurColor = '#1da34a';
var ascenseurIconSize = [1.5,13,2,22,60];
// Couche parking
var parkingCount = 0; // initialisation du compteur de clics
var parkingLink = document.getElementById('Parkings');
var parkingURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/paking_picto.png';
// Couche parking PMR
var parkingPMRCount = 0; // initialisation du compteur de clics
var parkingPMRURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/parkingH_picto.png';
// Couche parking vélo
var parkingVeloCount = 0; // initialisation du compteur de clics
var parkingVeloLink = document.getElementById("Parkings vélo");
var parkingVeloColor = 'purple';
var parkingVeloIconSize = [1.5,13,2,22,60];
// Couche Pole santé
var polesanteCount = 0; // initialisation du compteur de clics
var polesanteLink = document.getElementById('Pole santé');
var polesanteURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/sante_marker.png';
// Lineaire PMR
var lineairePMRCount = 0; // initialisation du compteur de clics
var lineairePMRLink = document.getElementById("Cheminements accessibles");
var lineairePMRColor = '#138fad';
var lineairePMRType = 'line'
// Couche Accès PMR
var accesPMRCount = 0; // initialisation du compteur de clics
var accesPMRColor = '#138fad';
var accesPMRIconSize = [1.5,13,2,22,60]
// Lineaire Metro
var lineaireMetroCount = 0; // initialisation du compteur de clics
var metroLink = document.getElementById("Métro");
var lineaireMetroColor = 'red';
var lineaireMetroIconSize = [1.5,13,2,22,60];
var lineaireMetroType = 'line';
// Couche arrets metro
var metroCount = 0; // initialisation du compteur de clics
var metroColor = 'red';
var metroIconSize = [1.5,13,4,22,80];
var metroURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/metro_picto.png';
// Couche arrets bus
var busCount = 0; // initialisation du compteur de clics
var busColor = 'green';
var busIconSize = [1.5,13,4,22,80];
var busURL = 'https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/layers_icons/bus_marker.png';
// Couche vélostar
var velostarCount = 0; // initialisation du compteur de clics
var velostarLink = document.getElementById("Parkings vélo");
var velostarColor = 'green';
// Couche bus
var busLineCount = 0; // initialisation du compteur de clics
var busLineLink = document.getElementById("Réseau de bus");
var busLineColor = '#3893F5';
//// Récupération en continu de l'état des menus des couches suivantes :
var ServicescenLinkState = null;
setInterval(function (){
ServicescenLinkState = ServicescenLink.nextElementSibling.className;
},500);
var ServicesgenLinkState = null;
setInterval(function (){
ServicesgenLinkState = ServicesgenLink.nextElementSibling.className;
},500);
var ServicescomLinkState = null;
setInterval(function (){
ServicescomLinkState = ServicescomLink.nextElementSibling.className;
},500);
setInterval(function (){
sallesSpeLinkState = sallesSpecifiquesLink.nextElementSibling.className;
},500);
var FUFRLLinkState = null;
setInterval(function (){
FUFRLLinkState = FUFRLLink.nextElementSibling.className;
},500);
var FUFRSHLinkState = null;
setInterval(function (){
FUFRSHLinkState = FUFRSHLink.nextElementSibling.className;
},500);
var FUFRSSLinkState = null;
setInterval(function (){
FUFRSSLinkState = FUFRSSLink.nextElementSibling.className;
},500);
var FUFRSTAPSLinkState = null;
setInterval(function (){
FUFRSTAPSLinkState = FUFRSTAPSLink.nextElementSibling.className;
},500);
var FUFRALCLinkState = null;
setInterval(function (){
FUFRALCLinkState = FUFRALCLink.nextElementSibling.className;
},500);
var RUFRLLinkState = null;
setInterval(function (){
RUFRLLinkState = RUFRLLink.nextElementSibling.className;
},500);
var RUFRSHLinkState = null;
setInterval(function (){
RUFRSHLinkState = RUFRSHLink.nextElementSibling.className;
},500);
var RUFRSSLinkState = null;
setInterval(function (){
RUFRSSLinkState = RUFRSSLink.nextElementSibling.className;
},500);
var RUFRSTAPSLinkState = null;
setInterval(function (){
RUFRSTAPSLinkState = RUFRSTAPSLink.nextElementSibling.className;
},500);
var RUFRALCLinkState = null;
setInterval(function (){
RUFRALCLinkState = RUFRALCLink.nextElementSibling.className;
},500);
var listLayers = [ServicescomLink,ServicesgenLink,ServicescenLink,sallesSpecifiquesLink,FUFRLLink,FUFRSHLink,FUFRSSLink,FUFRSTAPSLink,FUFRALCLink,RUFRLLink,RUFRSHLink,RUFRSSLink,RUFRSTAPSLink,RUFRALCLink];
////////////// Autres variables
var Layers = []; // Liste des couches
var popup = null; // Variable popup
var popupList = null; // Variable popup sur les listes d'enregistrements
// Coordonnées de la salle sélectionnée
var salleRX = null;
var salleRY = null;
var pictoCount = 0;
////////////////////////////////// Initialisation de de fonctions //////////////////////////////////////
//Variables nécessaires à la fonctionnalité de changement de vue (2D -> 3D)
var DDD = false; // Vue de base en 2D
var bati2DId = 'bati2DId'; // Identifiant de la couche de bati 2D
var bati2DCount = 0; // Nombre de fois que la couche de bati 2D a été appelée (< nécessité de changer d'identifiant)
var bati3DId = 'bati3dId'; // Identifiant de la couche de bati 3D
var bati3DCount = 0; // Nombre de fois que la couche de bati 3D a été appelée
var bati2DHId = 'bati2DHId'; // idem couche hover
var bati3DHId = 'bati3dHId'; // idem couche hover
var etiqBati2DId = 'etiqBati2DId'; // idem couche etiquette
var etiqBati3DId = 'etiqBati3DId'; // idem couche etiquette
var popupBati = new mapboxgl.Popup({ // Popup Hover Bati
closeButton: false,
closeOnClick: false
});
var popupContent = null
// Fonction pour afficher le référentiel bati 3D
function getBati3D(){
if (bati3DCount != 0){
map.removeLayer(bati2DId);
map.removeLayer(bati2DHId);
map.removeLayer(etiqBati2DId);
};
pictoCount +=1;
bati3DCount += 1;
bati3DId = 'bati3DId'+bati3DCount;
bati3DHId = 'bati3DHId'+bati3DCount;
etiqBati3DId = 'etiqBati3DId' + bati3DCount;
map.addLayer({
id: bati3DId,
type: "fill-extrusion",
source: {
type: "geojson",
data: "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/data/bati/Bati_3D.geojson"
},
paint: {
'fill-extrusion-color': '#d1d1e0',
'fill-extrusion-height':{
'type': 'identity',
'property': 'hauteur'
},
'fill-extrusion-base': {
'type': 'identity',
'property': 'hauteur_mi'},
'fill-extrusion-opacity': 0.8
}
},Layers[0]);
map.addLayer({
id: bati3DHId,
type: "fill-extrusion",
source: {
type: "geojson",
data: "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/data/bati/Bati_3D.geojson"
},
filter: ["==", "Nom", ""],
paint: {
'fill-extrusion-color': '#D82B09',
'fill-extrusion-height':{
'type': 'identity',
'property': 'hauteur'
},
'fill-extrusion-base': {
'type': 'identity',
'property': 'hauteur_mi'},
'fill-extrusion-opacity': 0.8
}
},Layers[0]);
map.on("mousemove", bati3DId, function(e) {
map.setFilter(bati3DHId, ["==", "Id", e.features[0].properties.Id]);
var popupTitle = '';
popupContent = '';
if (Layers.length == 0){
if (e.features[0].properties.Nom !== "null"){
popupTitle = e.features[0].properties.Nom;
}
if (e.features[0].properties.Photos !== "null"){
popupContent += '<img src = \''+ e.features[0].properties.Photos+'\'/>'
}
if (e.features[0].properties.Infos !== "null"){
popupContent += '<p>'+e.features[0].properties.Infos+'<p>';
}
if (popupBati!==null){
popupBati.remove();
};
if (e.features[0].properties.Nom !== "null"){
if ((popup == null || popup.isOpen()==false) && (searchPopup == null || searchPopup.isOpen() ===false) && (popupList == null || popupList.isOpen() ===false)){
popupBati = new mapboxgl.Popup({
offset: [0, -15],
closeButton: false
})
.setLngLat(e.lngLat)
.setHTML('<h1>'+popupTitle+'</h1>'+popupContent)
.addTo(map);
}
}
}
});
// Reset the state-fills-hover layer's filter when the mouse leaves the layer.
map.on("mouseleave", bati3DId, function() {
map.setFilter(bati3DHId, ["==", "Id", ""]);
popupBati.remove();
});
map.addLayer({
id: etiqBati3DId,
type: "symbol",
source: {
type: "geojson",
data: POIBrut
},
filter : [ '==','Categorie','Batiment'],
layout: {
"text-field": "{Etiquette}",
"text-anchor": "center",
"text-size":{'base': 1.3,'stops': [[13, 2.5], [22, 60]]},
"text-max-width":8
},
minzoom : 14,
});
addPictoFondDeCarte()
};
var popupContent = null
// Fonction pour afficher le référentiel bati 2D
function getBati2D(){
if (bati3DCount != 0){
map.removeLayer(bati3DId);
map.removeLayer(bati3DHId);
map.removeLayer(etiqBati3DId);
};
pictoCount +=1;
bati2DCount += 1;
bati2DId = 'bati2DId'+bati2DCount;
bati2DHId = 'bati2DHId'+bati2DCount;
etiqBati2DId='etiqBati2DId' + bati2DCount;
map.addLayer({
id: bati2DId,
type: "fill",
source: {
type: "geojson",
data: "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/data/bati/Bati_2D.geojson"
},
paint: {
'fill-color': '#9494b8',
'fill-opacity':0.8
}
},Layers[0]);
map.addLayer({
id: bati2DHId,
type: "fill",
source: {
type: "geojson",
data: "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/data/bati/Bati_2D.geojson"
},
filter: ["==", "Id", ""],
paint: {
'fill-color': '#D82B09',
'fill-opacity':0.5
}
},Layers[0]);
map.on("mousemove", bati2DId, function(e) {
map.setFilter(bati2DHId, ["==", "Id", e.features[0].properties.Id]);
var popupTitle = '';
popupContent = '';
if (Layers.length == 0){
if (e.features[0].properties.Nom !== "null"){
popupTitle = e.features[0].properties.Nom;
}
if (e.features[0].properties.Photo !== "null"){
popupContent += '<img src = \''+ e.features[0].properties.Photo+'\'/>'
}
if (e.features[0].properties.Info !== "null"){
popupContent += '<p>'+e.features[0].properties.Info+'<p>';
}
if (popupBati!==null){
popupBati.remove();
};
if (e.features[0].properties.Nom !== "null"){
if ((popup == null || popup.isOpen()==false) && (searchPopup == null || searchPopup.isOpen() ===false) && (popupList == null || popupList.isOpen() ===false)){
popupBati = new mapboxgl.Popup({
offset: [0, -15],
closeButton: false
})
.setLngLat(e.lngLat)
.setHTML('<h1>'+popupTitle+'</h1>'+popupContent)
.addTo(map);
}
}
}
});
// Reset the state-fills-hover layer's filter when the mouse leaves the layer.
map.on("mouseleave", bati2DId, function() {
map.setFilter(bati2DHId, ["==", "Id", ""]);
popupBati.remove();
});
map.addLayer({
id: etiqBati2DId,
type: "symbol",
source: {
type: "geojson",
data: POIBrut
},
filter : [ '==','Categorie','Batiment'],
layout: {
"text-field": "{Etiquette}",
"text-anchor": "center",
"text-size":{'base': 1.3,'stops': [[13, 2.5], [22, 60]]},
"text-max-width":8
},
minzoom : 14,
});
addPictoFondDeCarte()
};
function addPictoFondDeCarte(){
//picto fond de carte
//Bibliothèque
map.loadImage("https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/iconfond/biblio.png", function(error, image) {
if (error) throw error;
map.addImage('biblio', image);
map.addLayer({
"id": "biblio"+pictoCount,
"type": "symbol",
"source": {
"type": "geojson",
"data": "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/data/fondcarte/biblio.geojson"
},
"layout": {
"visibility": 'visible',
"icon-image": "biblio",
"icon-size": 0.90
},
minzoom : 15.5,
});
});
//Caféteria
map.loadImage("https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/iconfond/cafe.png", function(error, image) {
if (error) throw error;
map.addImage('cafe', image);
map.addLayer({
"id": "cafeteria"+pictoCount,
"type": "symbol",
"source": {
"type": "geojson",
"data": "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/data/fondcarte/cafeteria.geojson"
},
"layout": {
"visibility": 'visible',
"icon-image": "cafe",
"icon-size": 0.80
},
minzoom : 16.5,
});
});
//Restaurant U
map.loadImage("https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/iconfond/resto.png", function(error, image) {
if (error) throw error;
map.addImage('resto', image);
map.addLayer({
"id": "ru"+pictoCount,
"type": "symbol",
"source": {
"type": "geojson",
"data": "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/data/fondcarte/ru.geojson"
},
"layout": {
"visibility": 'visible',
"icon-image": "resto",
"icon-size": 0.80
},
minzoom : 15.5,
});
});
//Parking
map.loadImage("https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/iconfond/parking.png", function(error, image) {
if (error) throw error;
map.addImage('parking', image);
map.addLayer({
"id": "parking"+pictoCount,
"type": "symbol",
"source": {
"type": "geojson",
"data": "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/data/fondcarte/parking.geojson"
},
"layout": {
"visibility": 'visible',
"icon-image": "parking",
"icon-size": 0.50
},
minzoom : 15,
});
});
//Metro
map.loadImage("https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/iconfond/metro.png", function(error, image) {
if (error) throw error;
map.addImage('metro', image);
map.addLayer({
"id": "metro"+pictoCount,
"type": "symbol",
"source": {
"type": "geojson",
"data": "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/data/fondcarte/metro.geojson"
},
"layout": {
"visibility": 'visible',
"icon-image": "metro",
"icon-size": 0.80
},
minzoom : 15,
});
});
//Pôle Sante
map.loadImage("https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/iconfond/sante.png", function(error, image) {
if (error) throw error;
map.addImage('sante', image);
map.addLayer({
"id": "polesante"+pictoCount,
"type": "symbol",
"source": {
"type": "geojson",
"data": "https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/data/fondcarte/polesante.geojson"
},
"layout": {
"visibility": 'visible',
"icon-image": "sante",
"icon-size": 0.80
},
minzoom : 17,
});
});
//Piscine
map.loadImage("https://raw.githubusercontent.com/Xueimuohtreb/Plan-interactif/master/icons/iconfond/piscine.png", function(error, image) {
if (error) throw error;
map.addImage('piscine', image);
map.addLayer({