mirror of
https://github.com/placeAtlas/atlas.git
synced 2024-12-26 19:14:08 +01:00
Use index (position on Atlas data) for temporal order
This commit is contained in:
parent
a17b9df743
commit
da4efb6c60
2 changed files with 5 additions and 3 deletions
|
@ -500,7 +500,9 @@ async function init() {
|
|||
}
|
||||
|
||||
function updateAtlasAll(atlas = atlasAll) {
|
||||
for (const entry of atlas) {
|
||||
for (const index in atlas) {
|
||||
const entry = atlas[index]
|
||||
entry._index = index
|
||||
const currentLinks = entry.links
|
||||
entry.links = {
|
||||
website: [],
|
||||
|
|
|
@ -370,10 +370,10 @@ function buildObjectsList(filter, sort = defaultSort) {
|
|||
sortFunction = (a, b) => b.name.toLowerCase().localeCompare(a.name.toLowerCase())
|
||||
break
|
||||
case "newest":
|
||||
sortFunction = (a, b) => b.id.length - a.id.length || b.id.localeCompare(a.id)
|
||||
sortFunction = (a, b) => b._index - a._index
|
||||
break
|
||||
case "oldest":
|
||||
sortFunction = (a, b) => a.id.length - b.id.length || a.id.localeCompare(b.id)
|
||||
sortFunction = (a, b) => a._index - b._index
|
||||
break
|
||||
case "area":
|
||||
sortFunction = (a, b) => calcPolygonArea(b.path) - calcPolygonArea(a.path)
|
||||
|
|
Loading…
Reference in a new issue