make sure the active image is rendered above other photo markers

This commit is contained in:
Martin Raifer
2024-08-07 09:54:54 +02:00
parent 7e111944db
commit 136308821a
2 changed files with 10 additions and 1 deletions
+7 -1
View File
@@ -68,7 +68,13 @@ function searchLimited(limit, projection, rtree) {
let found = rtree.search(extent.bbox());
const spacing = Math.max(1, Math.floor(found.length / limit));
found = found
.filter((_, idx) => idx % spacing === 0)
.filter((d, idx) => idx % spacing === 0 ||
d.data.id === _activeImage?.id)
.sort((a, b) => {
if (a.data.id === _activeImage?.id) return -1;
if (b.data.id === _activeImage?.id) return 1;
return 0;
})
.slice(0, limit)
.map(function(d) { return d.data; });
+3
View File
@@ -249,10 +249,13 @@ export function svgPanoramaxImages(projection, context, dispatch) {
.append('g')
.attr('class', 'viewfield-scale');
const activeImageId = service.getActiveImage()?.id;
// update
const markers = groups
.merge(groupsEnter)
.sort(function(a, b) {
if (a.id === activeImageId) return 1;
if (b.id === activeImageId) return -1;
return b.loc[1] - a.loc[1]; // sort Y
})
.attr('transform', transform)