mirror of
https://github.com/placeAtlas/atlas.git
synced 2024-05-29 09:34:20 +02:00
Add config to prefer numerical IDs
Compat for 2017
This commit is contained in:
parent
63dd4f67e8
commit
abbab36445
|
@ -245,6 +245,9 @@ const variationsConfig = {
|
|||
}
|
||||
window.variationsConfig = variationsConfig
|
||||
|
||||
const useNumericalId = false
|
||||
window.useNumericalId = useNumericalId
|
||||
|
||||
console.info(`%cThe 2022 r/place Atlas
|
||||
%cCopyright (c) 2017 Roland Rytz <roland@draemm.li>
|
||||
Copyright (c) 2022 Place Atlas contributors
|
||||
|
|
|
@ -268,6 +268,10 @@ function initDraw() {
|
|||
center: {},
|
||||
}
|
||||
|
||||
if (useNumericalId) {
|
||||
if (!isNaN(Number(exportObject.id))) exportObject.id = Number(exportObject.id)
|
||||
}
|
||||
|
||||
const pathWithPeriodsTemp = JSON.parse(JSON.stringify(pathWithPeriods))
|
||||
|
||||
for (let i = pathWithPeriodsTemp.length - 1; i > 0; i--) {
|
||||
|
@ -518,7 +522,7 @@ function initDraw() {
|
|||
}
|
||||
|
||||
const getEntry = id => {
|
||||
const entries = atlasAll.filter(entry => entry.id === id)
|
||||
const entries = atlasAll.filter(entry => entry.id.toString() === id.toString())
|
||||
if (entries.length === 1) return entries[0]
|
||||
return {}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue