Spaces:
Sleeping
Sleeping
tyriaa
commited on
Commit
·
ab9b07d
1
Parent(s):
0d0c101
Initial deployment 3
Browse files- templates/index.html +9 -1
templates/index.html
CHANGED
@@ -118,7 +118,15 @@
|
|
118 |
const coordinates = incident.geometry.coordinates;
|
119 |
const type = incident.geometry.type;
|
120 |
|
121 |
-
if (type === "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
const [lon, lat] = coordinates;
|
123 |
const iconCategory = incident.properties.iconCategory;
|
124 |
|
|
|
118 |
const coordinates = incident.geometry.coordinates;
|
119 |
const type = incident.geometry.type;
|
120 |
|
121 |
+
if (type === "LineString") {
|
122 |
+
// Ajouter une polyligne rouge pour les incidents de type LineString
|
123 |
+
const latlngs = coordinates.map(coord => [coord[1], coord[0]]);
|
124 |
+
L.polyline(latlngs, {
|
125 |
+
color: 'red',
|
126 |
+
weight: 4,
|
127 |
+
opacity: 0.8
|
128 |
+
}).addTo(map);
|
129 |
+
} else if (type === "Point") {
|
130 |
const [lon, lat] = coordinates;
|
131 |
const iconCategory = incident.properties.iconCategory;
|
132 |
|