Skip to content

Commit 49f696d

Browse files
committed
map component: support pins with description but no title
1 parent 725c896 commit 49f696d

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- This is useful to quickly create filters at the top of a dashboard or report page, that will be automatically applied when the user changes them.
1616
- New `options_source` parameter in the form component. This allows to dynamically load options for dropdowns from a different SQL file.
1717
- This allows easily implementing autocomplete for form fields with a large number of possible options.
18+
- In the map component, add support for map pins with a description but no title.
1819

1920
## 0.32.1 (2025-01-03)
2021

sqlpage/sqlpage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function sqlpage_map() {
157157
: createGeoJSONMarker(marker_elem, options);
158158
marker.addTo(map);
159159
map._sqlpage_markers.push(marker);
160-
if (options.title) marker.bindPopup(marker_elem);
160+
if (marker_elem.textContent.trim()) marker.bindPopup(marker_elem);
161161
else if (marker_elem.dataset.link) {
162162
marker.on("click", () => {
163163
window.location.href = marker_elem.dataset.link;

sqlpage/templates/map.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
{{title}}
4343
{{~/if~}}
4444
</h3>
45-
<div>
45+
<div class="description">
4646
{{~#if description}}<p>{{description}}</p>{{/if~}}
4747
{{~#if description_md~}}
4848
{{{markdown description_md}}}

0 commit comments

Comments
 (0)