mirror of
https://github.com/placeAtlas/atlas.git
synced 2024-12-27 09:54:06 +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) {
|
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
|
const currentLinks = entry.links
|
||||||
entry.links = {
|
entry.links = {
|
||||||
website: [],
|
website: [],
|
||||||
|
|
|
@ -370,10 +370,10 @@ function buildObjectsList(filter, sort = defaultSort) {
|
||||||
sortFunction = (a, b) => b.name.toLowerCase().localeCompare(a.name.toLowerCase())
|
sortFunction = (a, b) => b.name.toLowerCase().localeCompare(a.name.toLowerCase())
|
||||||
break
|
break
|
||||||
case "newest":
|
case "newest":
|
||||||
sortFunction = (a, b) => b.id.length - a.id.length || b.id.localeCompare(a.id)
|
sortFunction = (a, b) => b._index - a._index
|
||||||
break
|
break
|
||||||
case "oldest":
|
case "oldest":
|
||||||
sortFunction = (a, b) => a.id.length - b.id.length || a.id.localeCompare(b.id)
|
sortFunction = (a, b) => a._index - b._index
|
||||||
break
|
break
|
||||||
case "area":
|
case "area":
|
||||||
sortFunction = (a, b) => calcPolygonArea(b.path) - calcPolygonArea(a.path)
|
sortFunction = (a, b) => calcPolygonArea(b.path) - calcPolygonArea(a.path)
|
||||||
|
|
Loading…
Reference in a new issue