cluster selection
This commit is contained in:
@@ -33,6 +33,7 @@ await store.fetchData();
|
||||
const shownClusters = ref<FeatureCollection<Point> | null>(null);
|
||||
const image = useSvgImage();
|
||||
const map = useMap("main");
|
||||
|
||||
watchEffect(async () => {
|
||||
const allClusters = [];
|
||||
for (const routeId of store.selectedRouteIds) {
|
||||
@@ -47,9 +48,10 @@ watchEffect(async () => {
|
||||
shownClusters.value = {
|
||||
type: "FeatureCollection",
|
||||
features: allClusters
|
||||
.map((c) => store.clustersById[c.id])
|
||||
.map((c) => store.clustersByCode[c.code])
|
||||
.filter((c) => c !== undefined),
|
||||
};
|
||||
|
||||
const firstPoint = shownClusters.value.features[0];
|
||||
if (!firstPoint) {
|
||||
map.map?.flyTo({ center, zoom });
|
||||
|
||||
Reference in New Issue
Block a user