Update script.js
Browse files
script.js
CHANGED
|
@@ -56,8 +56,9 @@ function addMarkers(data, icon) {
|
|
| 56 |
});
|
| 57 |
}
|
| 58 |
|
|
|
|
| 59 |
// Fetch and process the first dataset
|
| 60 |
-
fetch('
|
| 61 |
.then(response => {
|
| 62 |
if (!response.ok) {
|
| 63 |
throw new Error('Network response was not ok');
|
|
@@ -65,15 +66,15 @@ fetch('data.json')
|
|
| 65 |
return response.json();
|
| 66 |
})
|
| 67 |
.then(data => {
|
| 68 |
-
console.log('Fetched
|
| 69 |
-
addMarkers(data,
|
| 70 |
})
|
| 71 |
.catch(error => {
|
| 72 |
-
console.error('Error fetching
|
| 73 |
});
|
| 74 |
|
| 75 |
// Fetch and process the second dataset
|
| 76 |
-
fetch('
|
| 77 |
.then(response => {
|
| 78 |
if (!response.ok) {
|
| 79 |
throw new Error('Network response was not ok');
|
|
@@ -81,13 +82,12 @@ fetch('data_HQ_HF.json')
|
|
| 81 |
return response.json();
|
| 82 |
})
|
| 83 |
.then(data => {
|
| 84 |
-
console.log('Fetched
|
| 85 |
-
addMarkers(data,
|
| 86 |
})
|
| 87 |
.catch(error => {
|
| 88 |
-
console.error('Error fetching
|
| 89 |
});
|
| 90 |
-
|
| 91 |
|
| 92 |
|
| 93 |
|
|
|
|
| 56 |
});
|
| 57 |
}
|
| 58 |
|
| 59 |
+
|
| 60 |
// Fetch and process the first dataset
|
| 61 |
+
fetch('data_HQ_HF.json')
|
| 62 |
.then(response => {
|
| 63 |
if (!response.ok) {
|
| 64 |
throw new Error('Network response was not ok');
|
|
|
|
| 66 |
return response.json();
|
| 67 |
})
|
| 68 |
.then(data => {
|
| 69 |
+
console.log('Fetched data_HQ_HF.json:', data); // Log the fetched data
|
| 70 |
+
addMarkers(data, hqIcon);
|
| 71 |
})
|
| 72 |
.catch(error => {
|
| 73 |
+
console.error('Error fetching data_HQ_HF.json:', error);
|
| 74 |
});
|
| 75 |
|
| 76 |
// Fetch and process the second dataset
|
| 77 |
+
fetch('data.json')
|
| 78 |
.then(response => {
|
| 79 |
if (!response.ok) {
|
| 80 |
throw new Error('Network response was not ok');
|
|
|
|
| 82 |
return response.json();
|
| 83 |
})
|
| 84 |
.then(data => {
|
| 85 |
+
console.log('Fetched data.json:', data); // Log the fetched data
|
| 86 |
+
addMarkers(data, robotIcon);
|
| 87 |
})
|
| 88 |
.catch(error => {
|
| 89 |
+
console.error('Error fetching data.json:', error);
|
| 90 |
});
|
|
|
|
| 91 |
|
| 92 |
|
| 93 |
|