mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
sort markers by date (newest on top)
This commit is contained in:
@@ -76,7 +76,7 @@ function searchLimited(limit, projection, rtree) {
|
||||
return 0;
|
||||
})
|
||||
.slice(0, limit)
|
||||
.map(function(d) { return d.data; });
|
||||
.map(d => d.data);
|
||||
|
||||
return (found.length ? result.concat(found) : result);
|
||||
}, []);
|
||||
@@ -158,6 +158,7 @@ function loadTileDataToCache(data, tile, zoom) {
|
||||
d = {
|
||||
loc: loc,
|
||||
capture_time: feature.properties.ts,
|
||||
capture_time_parsed: new Date(feature.properties.ts),
|
||||
id: feature.properties.id,
|
||||
account_id: feature.properties.account_id,
|
||||
sequence_id: feature.properties.sequences.split('\"')[1],
|
||||
|
||||
@@ -254,9 +254,11 @@ export function svgPanoramaxImages(projection, context, dispatch) {
|
||||
const markers = groups
|
||||
.merge(groupsEnter)
|
||||
.sort(function(a, b) {
|
||||
// active image on top
|
||||
if (a.id === activeImageId) return 1;
|
||||
if (b.id === activeImageId) return -1;
|
||||
return b.loc[1] - a.loc[1]; // sort Y
|
||||
// else: sort by capture time (newest on top)
|
||||
return a.capture_time_parsed - b.capture_time_parsed;
|
||||
})
|
||||
.attr('transform', transform)
|
||||
.select('.viewfield-scale');
|
||||
|
||||
Reference in New Issue
Block a user