This commit is contained in:
a-ill 2023-07-21 18:07:22 +03:00
parent ccd97c1095
commit 9387cdca70
4 changed files with 34 additions and 6 deletions

View File

@ -23,6 +23,12 @@ export let communes = [
status: "forming", status: "forming",
members: 1, members: 1,
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"] contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
},
{
location: [["Switzerland"],[46.97045202584917, 8.05130091516525]],
status: "forming",
members: 1,
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
} }
] ]
@ -39,6 +45,16 @@ for (let c of communes) {
export let communesMarkersLayer = L.layerGroup() export let communesMarkersLayer = L.layerGroup()
export function translate(content, x) {
let out = content[x]
if (out==undefined) {
return x
}
else {
return out
}
}
export function addMarkersCommunes(map,content,locale) { export function addMarkersCommunes(map,content,locale) {
for (let g of communes) { for (let g of communes) {
let coordinates let coordinates
@ -55,7 +71,7 @@ export function addMarkersCommunes(map,content,locale) {
locationString = location.map(x => x).join(", ") locationString = location.map(x => x).join(", ")
} }
else { else {
locationString = location.map(x => content[x]).join(", ") locationString = location.map(x => translate(content, x)).join(", ")
} }
text += fieldText + locationString + "<br>" text += fieldText + locationString + "<br>"

View File

@ -113,8 +113,6 @@ export function translate(content, x) {
} }
} }
function addMarkersToLayer(g,layer,content,locale) { function addMarkersToLayer(g,layer,content,locale) {
let coordinates let coordinates
let text = "<b>"+content["Group"]+"</b><br>" let text = "<b>"+content["Group"]+"</b><br>"

View File

@ -23,6 +23,12 @@ export let communes = [
status: "forming", status: "forming",
members: 1, members: 1,
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"] contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
},
{
location: [["Switzerland"],[46.97045202584917, 8.05130091516525]],
status: "forming",
members: 1,
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
} }
] ]
@ -39,6 +45,16 @@ for (let c of communes) {
export let communesMarkersLayer = L.layerGroup() export let communesMarkersLayer = L.layerGroup()
export function translate(content, x) {
let out = content[x]
if (out==undefined) {
return x
}
else {
return out
}
}
export function addMarkersCommunes(map,content,locale) { export function addMarkersCommunes(map,content,locale) {
for (let g of communes) { for (let g of communes) {
let coordinates let coordinates
@ -55,7 +71,7 @@ export function addMarkersCommunes(map,content,locale) {
locationString = location.map(x => x).join(", ") locationString = location.map(x => x).join(", ")
} }
else { else {
locationString = location.map(x => content[x]).join(", ") locationString = location.map(x => translate(content, x)).join(", ")
} }
text += fieldText + locationString + "<br>" text += fieldText + locationString + "<br>"

View File

@ -113,8 +113,6 @@ export function translate(content, x) {
} }
} }
function addMarkersToLayer(g,layer,content,locale) { function addMarkersToLayer(g,layer,content,locale) {
let coordinates let coordinates
let text = "<b>"+content["Group"]+"</b><br>" let text = "<b>"+content["Group"]+"</b><br>"