More features and plants added

This commit is contained in:
2026-06-26 16:16:29 -05:00
parent c5725a0259
commit fe68874b92
3 changed files with 85 additions and 28 deletions
+6 -4
View File
@@ -188,7 +188,7 @@ function extendBounds(bounds, coordinates) {
function buildPopupContent(properties) {
const { kind, label, name, startDate, endDate, details, parentId, groupIds } = properties;
const entries = Object.entries(details ?? {}).filter(
([key, value]) => value !== null && value !== undefined && !key.endsWith("Url"),
([key, value]) => value !== null && value !== undefined && shouldShowDetailField(key),
);
const lifecycleEntries = [];
const relationshipEntries = [];
@@ -221,12 +221,16 @@ function buildPopupContent(properties) {
.map(([key, value]) => `<div><span>${escapeHtml(formatDetailLabel(key))}:</span> ${escapeHtml(formatDetailValue(key, value))}</div>`)
.join("");
const linkRows = linkEntries
.map((link) => `<div><span>${escapeHtml(link.label)}:</span> <a href="${escapeHtml(link.url)}" target="_blank" rel="noreferrer">${escapeHtml(link.url)}</a></div>`)
.map((link) => `<div><a href="${escapeHtml(link.url)}" target="_blank" rel="noreferrer">Info</a></div>`)
.join("");
return `${title}${subtitle}<div>${detailRows}${linkRows}</div>`;
}
function shouldShowDetailField(key) {
return !key.endsWith("Url") && key !== "gardenOrgId";
}
function formatDetailLabel(key) {
const labels = {
canopyDiameterMeters: "Canopy diameter",
@@ -239,8 +243,6 @@ function formatDetailLabel(key) {
cultivar: "Cultivar",
bloomColor: "Bloom color",
bloomSeason: "Bloom season",
daylilyDatabaseId: "Daylily database ID",
daylilyDatabaseUrl: "Daylily database URL",
species: "Species",
fenceType: "Fence type",
axis: "Axis",