Skip to content

Commit 39f926a

Browse files
authored
Merge pull request #29 from OpenWebconcept/feature/OWC-123
OWC-123 fix c.find error
2 parents 6a6a8d4 + 52b08f1 commit 39f926a

6 files changed

Lines changed: 24 additions & 21 deletions

File tree

build/blocks/owc-openkaarten/streetmap/client.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/blocks/owc-openkaarten/streetmap/client.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/blocks/owc-openkaarten/streetmap/editor.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/blocks/owc-openkaarten/streetmap/style.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/mix-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"/blocks/owc-openkaarten/streetmap/client.js": "/blocks/owc-openkaarten/streetmap/client.js?id=894e914505936c8b2ddc1b23f7057b26",
2+
"/blocks/owc-openkaarten/streetmap/client.js": "/blocks/owc-openkaarten/streetmap/client.js?id=3c8f46a7300885cb005671988f825e18",
33
"/blocks/owc-openkaarten/streetmap/style.css": "/blocks/owc-openkaarten/streetmap/style.css?id=0c70cc29722d11466724176fc03cdd58",
44
"/blocks/owc-openkaarten/streetmap/editor.css": "/blocks/owc-openkaarten/streetmap/editor.css?id=f4316f0723fb86e3b028a9b448b1f3ae"
55
}
Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
export const makeTooltipCard = (location, dataset) => {
2-
const { title, type } = dataset;
3-
const tooltipData = location.properties?.tooltip || [];
4-
5-
return {
6-
datasetTitle: title,
7-
datasetId: location.id,
8-
datasetType: type,
9-
locationTitle: tooltipData.find(t => t.layout === 'title')?.title || location.title,
10-
meta: tooltipData.find(t => t.layout === 'meta')?.meta || '',
11-
text: tooltipData.find(t => t.layout === 'text')?.text || '',
12-
button: tooltipData.find(t => t.layout === 'button') || null,
13-
image: tooltipData.find(t => t.layout === 'image')?.image || '',
14-
properties: location.properties,
15-
coordinates: location.geometry.coordinates
16-
};
17-
}
2+
const { title, type } = dataset;
3+
const tooltipData = location.properties?.tooltip || [];
4+
5+
// Ensure tooltipData is an array
6+
const tooltipArray = Array.isArray(tooltipData) ? tooltipData : Object.values(tooltipData);
7+
8+
return {
9+
datasetTitle: title,
10+
datasetId: location.id,
11+
datasetType: type,
12+
locationTitle: tooltipArray.find(t => t.layout === 'title')?.title || location.properties?.title,
13+
meta: tooltipArray.find(t => t.layout === 'meta')?.meta || '',
14+
text: tooltipArray.find(t => t.layout === 'text')?.text || '',
15+
button: tooltipArray.find(t => t.layout === 'button') || null,
16+
image: tooltipArray.find(t => t.layout === 'image')?.image || '',
17+
properties: location.properties,
18+
coordinates: location.geometry.coordinates,
19+
};
20+
}

0 commit comments

Comments
 (0)