Move map files to 'kat'

This commit is contained in:
2024-02-05 15:17:01 +01:00
parent a71a95d68b
commit 166b356d21
6 changed files with 16 additions and 16 deletions
+4 -4
View File
@@ -8,10 +8,10 @@
<body>
<h1>Choisis une carte</h1>
<ul>
<li><a href="971.php">Guadeloupe (971)</a></li>
<li><a href="972.php">Martinique (972)</a></li>
<li><a href="973.php">Guyane (973)</a></li>
<li><a href="974.php">La Réunion (974)</a></li>
<li><a href="kat/971.php">Guadeloupe (971)</a></li>
<li><a href="kat/972.php">Martinique (972)</a></li>
<li><a href="kat/973.php">Guyane (973)</a></li>
<li><a href="kat/974.php">La Réunion (974)</a></li>
</ul>
</body>
</html>
+4 -4
View File
@@ -47,7 +47,7 @@ switch (codeDepartement) {
*/
const map = new maplibregl.Map({
container: 'map',
style: `./kat/styles/${styleFileName}`,
style: `../kat/styles/${styleFileName}`,
center: centerCoordinates,
zoom: zoomLevel
})
@@ -112,7 +112,7 @@ const correctAnswers = new Set()
*/
async function getFile(codeDepartement) {
try {
const response = await fetch(`./kat/data/${codeDepartement}/contours-communes.geojson`)
const response = await fetch(`../kat/data/${codeDepartement}/contours-communes.geojson`)
if (!response.ok) {
throw new Error(`Échec du chargement du fichier JSON : ${response.statusText}`)
}
@@ -135,7 +135,7 @@ async function getFile(codeDepartement) {
async function getCommuneCenterCoordinates(codeDepartement, communeCode) {
try {
// Utiliser fetch pour lire le fichier "centres.json"
const response = await fetch(`./kat/data/${codeDepartement}/centres.json`)
const response = await fetch(`../kat/data/${codeDepartement}/centres.json`)
if (!response.ok) {
throw new Error(`Échec du chargement du fichier JSON : ${response.statusText}`)
}
@@ -229,7 +229,7 @@ map.on('load', async () => {
*/
map.addSource('communes', {
'type': 'geojson',
'data': `./kat/data/${codeDepartement}/contours-communes.geojson`,
'data': `../kat/data/${codeDepartement}/contours-communes.geojson`,
'promoteId': 'code'
})
+2 -2
View File
@@ -3,7 +3,7 @@
<head>
<title>JWE - KAT</title>
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css" />
<link rel="stylesheet" href="./css/map.css" />
<link rel="stylesheet" href="../css/map.css" />
</head>
<body>
<h1 id="title">Guadeloupe (971)</h1>
@@ -21,6 +21,6 @@
<div id="map"></div>
<script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js"></script>
<script src="./js/map.js"></script>
<script src="../js/map.js"></script>
</body>
</html>
+2 -2
View File
@@ -3,7 +3,7 @@
<head>
<title>JWE - KAT</title>
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css" />
<link rel="stylesheet" href="./css/map.css" />
<link rel="stylesheet" href="../css/map.css" />
</head>
<body>
<h1 id="title">Martinique (972)</h1>
@@ -21,6 +21,6 @@
<div id="map"></div>
<script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js"></script>
<script src="./js/map.js"></script>
<script src="../js/map.js"></script>
</body>
</html>
+2 -2
View File
@@ -3,7 +3,7 @@
<head>
<title>JWE - KAT</title>
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css" />
<link rel="stylesheet" href="./css/map.css" />
<link rel="stylesheet" href="../css/map.css" />
</head>
<body>
<h1 id="title">Guyane (973)</h1>
@@ -21,6 +21,6 @@
<div id="map"></div>
<script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js"></script>
<script src="./js/map.js"></script>
<script src="../js/map.js"></script>
</body>
</html>
+2 -2
View File
@@ -3,7 +3,7 @@
<head>
<title>JWE - KAT</title>
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css" />
<link rel="stylesheet" href="./css/map.css" />
<link rel="stylesheet" href="../css/map.css" />
</head>
<body>
<h1 id="title">La Réunion (974)</h1>
@@ -21,6 +21,6 @@
<div id="map"></div>
<script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js"></script>
<script src="./js/map.js"></script>
<script src="../js/map.js"></script>
</body>
</html>