diff --git a/app/components/map/clusters.client.vue b/app/components/map/clusters.client.vue
index 260646a..826288d 100644
--- a/app/components/map/clusters.client.vue
+++ b/app/components/map/clusters.client.vue
@@ -8,6 +8,19 @@
@mouseenter="clusterEnter"
@mouseleave="clusterLeave"
/>
+
+
();
+const cluster_paint = {
+ "circle-radius": 18,
+ "circle-color": "#" + route.color,
+};
+
const popupData = ref([]);
const popup = new Popup().setMaxWidth("500px").addTo(map.map!);
@@ -65,21 +80,23 @@ async function clusterClick(e: FeatureCollection) {
if (!code) {
return;
}
- let data;
+ // let data;
const coordinates = feature.geometry.coordinates.slice();
- [data, popupData.value] = await Promise.all([
- $fetch>(
- `https://data.mobilites-m.fr/api/clusters/${code}/stops`,
- ),
- $fetch(
- `https://data.mobilites-m.fr/api/routers/default/index/clusters/${feature.properties.code}/stoptimes?showCancelledTrips=false&route=${route.id}`,
- {
- headers: {
- origin: "PersonalProjectMreso",
- },
+ // [data, popupData.value] = await Promise.all([
+ // $fetch>(
+ // `https://data.mobilites-m.fr/api/clusters/${code}/stops`,
+ // ),
+
+ // ]);
+
+ popupData.value = await $fetch(
+ `https://data.mobilites-m.fr/api/routers/default/index/clusters/${feature.properties.code}/stoptimes?showCancelledTrips=false&route=${route.id}`,
+ {
+ headers: {
+ origin: "PersonalProjectMreso",
},
- ),
- ]);
+ },
+ );
popup.setDOMContent(popupDiv.value).setLngLat(coordinates).addTo(map.map!);
}
diff --git a/app/components/map/map.client.vue b/app/components/map/map.client.vue
index 3f354d1..bafdb58 100644
--- a/app/components/map/map.client.vue
+++ b/app/components/map/map.client.vue
@@ -2,6 +2,7 @@
+
| null>(null);
-
+const image = useSvgImage();
const map = useMap("main");
watchEffect(async () => {
const allClusters = [];
@@ -61,7 +63,7 @@ watchEffect(async () => {
// .filter((c) => stops.includes(c.properties?.id))
.reduce(
(bounds, coords) => {
- return bounds.extend(new LngLat(coords[0], coords[1]));
+ return bounds.extend(new LngLat(coords[0]!, coords[1]!));
},
new LngLatBounds([
firstPoint.geometry.coordinates[0]!,