-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
543 lines (439 loc) · 19.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
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
<!DOCTYPE html>
<html>
<head>
<title>ResMap</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="./img/tab_icon.png" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" -->
<!-- integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.4.3/css/ol.css"
type="text/css">
<link rel="stylesheet" href="./css/style.css">
</head>
<body>
<main class="" role="main">
<div id="map"><div id="popup"></div>
</main>
<div class="boxRedir lien-blanc">
Ceci est une version éducative réalisée lors d'un projet de semestre.
<br />
La version définitive utilisable est disponible sous ce
<a href="https://maxouch742.github.io/ResMap2/">lien</a>
</div>
<div class="boxMenu absolutePosition">
<img class="py-2 center" src="./img/ResMap_logo.svg" >
<!-- <p class="text-center mb-3">Interface web permettant la visualisation des résultats d'un calcul de réseau 2D issu de LTOP</p> -->
<div class="mt-2 greyBackground border border-dark p-1">
<h5 class="mx-2">Import du fichier .PRNx</h5>
<input class="mx-2 my-1 pr-2 inputFile" type="file" id="inputfile" accept=".prnx"></input>
<p class="mx-2 my-1 importInfo" id="outputTest"> </p>
</div>
<button class ="accordion mt-2 py-1" id="coucheButton">Menu</button>
<div class="panel scroller">
<div class="mt-2">
<button class="accordion py-1">Points</button>
<div class="panel">
<div>
<input class="form-check-input" type="checkbox" id="checkboxPointsFixes" onchange="changeLayerVisibilityFixedPoints()" checked>
<label class="checkboxLabel" for="checkboxPointsFixes">
Points fixes
</label>
</div>
<div class="NoPtsDecalage">
<input class="form-check-input NoPtsCheckbox" type="checkbox" id="checkboxPointsFixesNo" onchange="changeLayerVisibilityTextFixedPoints()" checked>
<label class="checkboxLabel NoPtsTxt" for="checkboxPointsFixesNo">
N° points fixes
</label>
</div>
<div>
<input class="form-check-input" type="checkbox" id="checkboxPointsNouv" onchange="changeLayerVisibilityVariablePoints()" checked>
<label class="checkboxLabel" for="checkboxPointsNouv">
Points nouveaux
</label>
</div>
<div class="NoPtsDecalage">
<input class="form-check-input NoPtsCheckbox" type="checkbox" id="checkboxPointsVariableNo" onchange="changeLayerVisibilityTextVariablePoints()" checked>
<label class="checkboxLabel NoPtsTxt" for="checkboxPointsVariableNo">
N° points nouveaux
</label>
</div>
</div>
</div>
<div class="mt-2">
<button class="accordion py-1">Observations terrestres</button>
<div class="panel">
<div>
<input class="form-check-input" type="checkbox" id="checkboxDirections" onchange="changeLayerVisibilityDirections()" checked>
<label class="checkboxLabel" for="checkboxDirections" id="legendeDir">
Directions
</label>
</div>
<div>
<input class="form-check-input" type="checkbox" id="checkboxDistances" onchange="changeLayerVisibilityDistances()" checked>
<label class="checkboxLabel" for="checkboxDistances" id="legendeDist">
Distances
</label>
</div>
</div>
</div>
<div class="mt-2">
<button class="accordion py-1">Observations de coordonnées</button>
<div class="panel">
<div>
<input class="form-check-input" type="checkbox" id="checkboxCoordE" onchange="changeLayerVisibilityCoordE()" >
<label class="checkboxLabel" for="checkboxCoordE">
E / Y
</label>
</div>
<div>
<input class="form-check-input" type="checkbox" id="checkboxCoordN" onchange="changeLayerVisibilityCoordN()" >
<label class="checkboxLabel" for="checkboxCoordN">
N / X
</label>
</div>
</div>
</div>
<div class="mt-2">
<button class="accordion py-1" clicked>Sessions GNSS</button>
<div class="panel">
<div>
<input class="form-check-input" type="checkbox" id="checkboxGnss" onchange="changeLayerVisibilityGnss()">
<label class="checkboxLabel" for="checkboxGnss">
Session 1,2,3, etc.
</label>
</div>
</div>
</div>
<div class="mt-2">
<button class="accordion py-1">Indicateurs de précisions</button>
<div class="panel">
<div>
<input class="form-check-input" type="checkbox" id="checkboxEllipses" onchange="changeLayerVisibilityEllipses()">
<label class="checkboxLabel" for="checkboxEllipses">
Ellipses de confiance
</label>
<div>
<div class="textEchelleLegende" id="AffichageEchelleEllipse">⤷ Echelle: </div>
</div>
</div>
<div>
<input class="form-check-input" type="checkbox" id="checkboxEllipsesRela" onchange="changeLayerVisibilityEllipsesRela()">
<label class="checkboxLabel" for="checkboxEllipsesRela" id="legendeEllRela">
Ellipses de confiance relatives
</label>
<div>
<div class="textEchelleLegende" id="AffichageEchelleEllipseRela">⤷ Echelle: </div>
</div>
</div>
</div>
</div>
<div class="mt-2">
<button class="accordion py-1" clicked>Indicateurs de fiabilité</button>
<div class="panel">
<div>
<input class="form-check-input" type="checkbox" id="checkboxRectangles" onchange="changeLayerVisibilityRectangles()">
<label class="checkboxLabel" for="checkboxRectangles">
Rectanlges de fiabilité externe
</label>
<div>
<div class="textEchelleLegende" id="AffichageEchelleRectangles">⤷ Echelle: </div>
</div>
</div>
<div>
<input class="form-check-input" type="checkbox" id="checkboxRectanglesRela" onchange="changeLayerVisibilityRectanglesRela()">
<label class="checkboxLabel" for="checkboxRectanglesRela" id="legendeRectRela">
Rectanlges de fiab. ext. relatifs
</label>
<div>
<div class="textEchelleLegende" id="AffichageEchelleRectanglesRela">⤷ Echelle: </div>
</div>
</div>
<div>
<input class="form-check-input" type="checkbox" id="checkboxFiabLoc" onchange="changeLayerVisibilityFiabLoc()">
<label class="checkboxLabel" for="checkboxFiabLoc">
Carte des fiabilités locales (zi)
</label>
<div>
<div class="textEchelleLegende fontColorFiab1">―― 0 - 25 %</div>
<div class="textEchelleLegende fontColorFiab2">―― 25 - 50 %</div>
<div class="textEchelleLegende fontColorFiab3">―― 50 - 75 %</div>
<div class="textEchelleLegende fontColorFiab4">―― 75 - 100 %</div>
</div>
</div>
</div>
</div>
<div class="mt-2">
<button class="accordion py-1">Résidus normés</button>
<div class="panel">
<div>
<input class="form-check-input" type="checkbox" id="checkboxResidusNormes" onchange="changeLayerVisibilityWi()">
<label class="checkboxLabel" for="checkboxResidusNormes" id="legendeWi">
Carte des résidus normés (wi)
</label>
<div>
<div class="textEchelleLegende fontColorFiab1" id="palierWi1">―― x - ∞</div>
<div class="textEchelleLegende fontColorFiab2" id="palierWi2">―― x - x</div>
<div class="textEchelleLegende fontColorFiab4" id="palierWi3">―― 0.0 - x</div>
</div>
</div>
</div>
</div>
<div class="mt-2">
<button class="accordion py-1">Diff. avec coordonnées initiales</button>
<div class="panel">
<div>
<input class="form-check-input" type="checkbox" id="checkboxVect" onchange="changeLayerVisibilityVect()">
<label class="checkboxLabel" for="checkboxVect">
Vecteurs DY/DX
</label>
</div>
<div>
<div class="textEchelleLegende" id="AffichageEchelleVect">⤷ Echelle: </div>
</div>
</div>
</div>
</div>
</div>
<div class="creditHEIG">
Matteo Casto © HEIG-VD 2022
</div>
<div class="slidecontainer">
<input type="range" min="0" max="9999" step="10" value="1000" class="slider" id="myRange">
<div>
<span class="textEchelle">Echelle des ellipses, rectangles et vecteurs → </span>
<span id="textEchelle" class="textEchelle"></span>
<span class="textEchelle">:1</span>
<div class="textEchelle" id="nivConfiance">Niveau de confiance des ellipses → </div>
</div>
</div>
<div class="WMSabsolutePosition">
<button class="accordion py-2"><img src="./img/mapWMS_MENU.png" width="50"></button>
<div class="panel">
<div>
<input class="form-check-input" type="radio" name="flexRadioDefault" id="cb_CN" onchange="changeBackground()">
<label class="form-check-label" for="cb_CN">
CN
</label>
</div>
<div>
<input class="form-check-input" type="radio" name="flexRadioDefault" id="cb_MO" onchange="changeBackground()" checked>
<label class="form-check-label" for="cb_MO">
MO
</label>
</div>
<div>
<input class="form-check-input" type="radio" name="flexRadioDefault" id="cb_img" onchange="changeBackground()">
<label class="form-check-label" for="cb_img">
ortho
</label>
</div>
<div>
<input class="form-check-input" type="radio" name="flexRadioDefault" id="cb_relief" onchange="changeBackground()">
<label class="form-check-label" for="cb_relief">
relief
</label>
</div>
<div>
<div>
<input class="form-check-input" type="radio" name="flexRadioDefault" id="cb_none" onchange="changeBackground()">
<label class="form-check-label" for="cb_none">
-
</label>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"
integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<!-- <script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.4.3/build/ol.js"></script> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.6.2/proj4.js"
integrity="sha512-cgJnZ1VX2G0MAN4C5OGShwI3zHhfQ6RLriXuukhblNu+T082/ZRGoWLP/0xMKObvB6AUKdnm27hQKj8hKZPjXA=="
crossorigin="anonymous"></script>
<!-- <script src="https://unpkg.com/elm-pep@1.0.6/dist/elm-pep.js"></script> -->
<script src="./js/OpenLayers_v6.4.3.js"></script>
<script src="./js/ParsingPointsXML.js"></script>
<script src="./js/ParsingViseesXML.js"></script>
<script src="./js/CheckboxChangeLayers.js"></script>
<script src="./js/CenterViewOnProject.js"></script>
<script src="./js/ParsingEllipsesXML.js"></script>
<script src="./js/ParsingEllipsesRelaXML.js"></script>
<script src="./js/ParsingRectanglesXML.js"></script>
<script src="./js/ParsingRectanglesRelaXML.js"></script>
<script src="./js/ParsingGnssXML.js"></script>
<script src="./js/ParsingObsCoordXML.js"></script>
<script src="./js/LocalReliability.js"></script>
<script src="./js/Wi.js"></script>
<script src="./js/ParsingVectXML.js"></script>
<script src="./js/ChangeBackground.js"></script>
<script>
// --------------- INITIALISATION DE LA MAP ---------------
// Définition de projection MN95
proj4.defs(
"EPSG:2056",
"+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1"
+ " +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs"
);
ol.proj.proj4.register(proj4);
// Fond WMTS CN à échelle dynamique
const carteNationale = new ol.layer.Tile({
source: new ol.source.TileWMS({
url: "https://wms.geo.admin.ch/",
params: {
layers: "ch.swisstopo.pixelkarte-farbe"
},
attributions: ["© <a href=\"https://www.geo.admin.ch/fr/home.html\">WMTS CarteNationale / geo.admin.ch</a>"]
}),
opacity: 0.2
});
// Fond WMTS swissImage à échelle dynamique
const swissImage = new ol.layer.Tile({
source: new ol.source.TileWMS({
url: "https://wms.geo.admin.ch/",
params: {
layers: "ch.swisstopo.swissimage"
},
attributions: ["© <a href=\"https://www.geo.admin.ch/fr/home.html\">WMTS SWISSIMAGE / geo.admin.ch</a>"]
}),
opacity: 0.5
});
// Fond SwissALTI3D relief multidirectionnel à échelle dynamique
const SwissSURFACE3D = new ol.layer.Tile({
source: new ol.source.TileWMS({
url: "https://wms.geo.admin.ch/",
params: {
layers: "ch.swisstopo.swisssurface3d-reliefschattierung-multidirektional"
},
attributions: ["© <a href=\"https://www.geo.admin.ch/fr/home.html\">WMTS Relief multidir. issu de SwissSURFACE3D / geo.admin.ch</a>"]
}),
opacity: 0.5
});
// MO noir et blanc
const attributions_geodienste = [
"Fond de plan © <a href=\"https://geodienste.ch\">geodienste</a>"
];
const MO_nb = new ol.layer.Tile({
id: "background-layer",
source: new ol.source.TileWMS({
url: `https://geodienste.ch/db/av_0/fra?`,
params: { 'LAYERS': 'LCSF,LCSFPROJ,Conduites,SOLI,SOSF,SOPT,Adresses_des_batiments,Nomenclature,Biens_fonds,Biens_fonds_projetes,Limites_territoriales', 'TILED': true },
attributions: attributions_geodienste,
}),
zIndex: -99,
opacity: 0.5
});
// Projection suisse
const projection = new ol.proj.Projection({
code: "EPSG:2056",
units: "m"
});
// Vue de base (centre et zoom), avec projection
const view = new ol.View({
center: [2600000, 1200000], // par défault
projection,
zoom: 9
});
// Ajout de la Map
const map = new ol.Map({
target: "map",
layers: [
MO_nb,
],
view,
controls: ol.control.defaults({
attributionOptions: {
collapsible: true, // Copyright affiché
visible: false
}
})
});
</script>
<script>
// --------------- SCRIPT PRINCIPAL ---------------
// Compte global du nombre d'observations supprimées
nbObsSuppr = 0
// Ajout d'écouteur d'événement sur le "change" du open-folder
document.getElementById('inputfile').addEventListener('change', function() {
// Récupération du nom de fichier PRNx
fileName = document.getElementById('inputfile').files[0]
// Lecture du contenu du fichier PRNx et appel des fonctions de parsing et création d'entités
let fr = new FileReader();
fr.onload=function() {
xmlToParse = fr.result;
parser = new DOMParser();
xmlDoc = parser.parseFromString(xmlToParse,"text/xml");
let listAllPoints = parsingPointsXML(xmlToParse);
centerViewOnProject(listAllPoints);
// CHANGER ECHELLE ELLIPSES ET RECTANGLES PAR DEFAULT CI-DESSSOUS
echelleEllipses = 1000.0
// Lancement des traitement pour affichages
parsingViseesXML(xmlToParse);
parsingEllipsesXML(xmlToParse);
parsingEllipsesRelaXML(xmlToParse);
parsingRectanglesXML(xmlToParse);
parsingRectanglesRelaXML(xmlToParse);
parsingGNSS(xmlToParse);
parsingObsCoord(xmlToParse);
parsingVectXML(xmlToParse);
map.removeLayer(directionLayer); //pour ordre d'affichage et gestion des animations
map.removeLayer(distanceLayer); //pour ordre d'affichage et gestion des animations
fiabLocale();
parsingViseesXML(xmlToParse);
normedResidualsWi();
map.removeLayer(directionLayer); //pour ordre d'affichage et gestion des animations
map.removeLayer(distanceLayer); //pour ordre d'affichage et gestion des animations
parsingViseesXML(xmlToParse);
fiabLocale();
map.removeLayer(directionLayer); //pour ordre d'affichage et gestion des animations
map.removeLayer(distanceLayer); //pour ordre d'affichage et gestion des animations
parsingViseesXML(xmlToParse);
document.getElementById("outputTest").textContent = "Import effectué ✓";
};
fr.readAsText(fileName);
});
</script>
<script>
// --------------- SCRIPT POUR ACCORDEON ---------------
let acc = document.getElementsByClassName("accordion");
let i;
for (i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function() {
this.classList.toggle("active");
let panel = this.nextElementSibling;
if (panel.style.maxHeight) {
panel.style.maxHeight = null;
} else {
panel.style.maxHeight = panel.scrollHeight + "px";
}
});
}
</script>
<script>
// --------------- SCRIPT POUR SLIDING BAR ECHELLE ---------------
let slider = document.getElementById("myRange");
let output = document.getElementById("textEchelle");
output.innerHTML = slider.value;
// Update the current slider value (each time you drag the slider handle)
slider.oninput = function() {
output.innerHTML = this.value;
map.removeLayer(ellipseLayer);
map.removeLayer(rectangleLayer);
map.removeLayer(vectLayer);
if (xmlDoc.getElementsByTagName("relativeEllipses").length != 0){ // On retire uniquement le Layer ellipseRelaLayer si il y en a
map.removeLayer(ellipseRelaLayer);
};
if (xmlDoc.getElementsByTagName("relativeRectangles").length != 0){ // On retire uniquement le Layer rectangleRelaLayer si il y en a
map.removeLayer(rectangleRelaLayer);
};
echelleEllipses = parseFloat(this.value);
parsingEllipsesXML(xmlToParse);
parsingRectanglesXML(xmlToParse);
parsingEllipsesRelaXML(xmlToParse);
parsingRectanglesRelaXML(xmlToParse);
parsingVectXML(xmlToParse);
}
</script>
<script src="./js/PopUpCoords.js"></script>
<script src="./js/Export.js"></script>
</body>