Skip to content

Commit

Permalink
Merge pull request #2926 from mashehu/fix-location-map
Browse files Browse the repository at this point in the history
filter our index page in map
  • Loading branch information
mashehu authored Jan 13, 2025
2 parents cada50d + 8952c79 commit 97fcb1e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sites/main-site/src/components/event/EventMap.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ let events = await getCollection('events', ({ slug }) => {
return slug.startsWith(event);
});
const local_sites_map: {
let local_sites_map: {
location: [number, number];
name: string;
url: string;
}[] = events.map((site) => {
const location = site.data.locations?.[0];
if (location) {
if (location && location.geoCoordinates) {
return {
location: location.geoCoordinates,
name: site.data.title,
Expand All @@ -23,6 +23,8 @@ const local_sites_map: {
}
return null;
});
// remove null values
local_sites_map = local_sites_map.filter((site) => site !== null);
---

<div>
Expand Down

0 comments on commit 97fcb1e

Please sign in to comment.