feat: add entry url to map_entries data and as data-url attribute on all markers
This commit is contained in:
@@ -27,7 +27,8 @@
|
||||
'lat': item.page.header.lat|number_format(6, '.', ''),
|
||||
'lng': item.page.header.lng|number_format(6, '.', ''),
|
||||
'slug': item.page.slug,
|
||||
'title': item.page.title
|
||||
'title': item.page.title,
|
||||
'url': item.page.url
|
||||
}]) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
@@ -147,6 +148,7 @@ homeMap.on('load', function () {
|
||||
bounds.extend(lngLat);
|
||||
|
||||
var el = MapUtils.createDotMarker(isLatest);
|
||||
el.dataset.url = entry.url;
|
||||
var popup = new maplibregl.Popup({ offset: 12, closeButton: false, closeOnClick: false, className: 'map-tip-popup' })
|
||||
.setLngLat(lngLat)
|
||||
.setHTML('<span class="map-tip">' + entry.title + '</span>');
|
||||
|
||||
Reference in New Issue
Block a user