Update
This commit is contained in:
@@ -1,25 +1,36 @@
|
||||
|
||||
export let communes = [
|
||||
{
|
||||
location: ["CanadaMontreal",[45.55541047232767, -73.42859611607271]],
|
||||
location: [["Canada","Montreal"],[45.55541047232767, -73.42859611607271]],
|
||||
status: "forming",
|
||||
members: 2,
|
||||
contact: ["https://discord.gg/xAPZmyr8B6","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: ["EstoniaKohtlaJarve",[59.409521829709504, 27.288415912535914]],
|
||||
location: [["Estonia","KohtlaJarve"],[59.409521829709504, 27.288415912535914]],
|
||||
status: "forming",
|
||||
members: 2,
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh","WhatsAppInviteLink"]
|
||||
contact: ["https://discord.gg/xAPZmyr8B6","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: ["Latvia",[56.934159375258055, 25.269099001330265]],
|
||||
location: [["Latvia",""],[56.934159375258055, 25.269099001330265]],
|
||||
status: "forming",
|
||||
members: 1,
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh","WhatsAppInviteLink"]
|
||||
contact: ["https://discord.gg/xAPZmyr8B6","DiscordInviteLink"]
|
||||
}
|
||||
]
|
||||
|
||||
export let communesByCountry = {}
|
||||
for (let c of communes) {
|
||||
let country = c.location[0][0]
|
||||
if (country in communesByCountry) {
|
||||
communesByCountry[country].push(c)
|
||||
}
|
||||
else {
|
||||
communesByCountry[country] = [c]
|
||||
}
|
||||
}
|
||||
|
||||
export function addMarkersCommunes(map,content) {
|
||||
for (let g of communes) {
|
||||
let coordinates
|
||||
@@ -30,7 +41,9 @@ export function addMarkersCommunes(map,content) {
|
||||
text += fieldText + "<a href='" + g.contact[0] + "' target='_blank' rel=noreferrer>" + content[g.contact[1]]+ "</a>"
|
||||
}
|
||||
else if (field=="location") {
|
||||
text += fieldText + content[g[field][0]]+ "<br>"
|
||||
let location = g[field][0]
|
||||
let town = location[1]=="" ? "" : ", " + content[location[1]]
|
||||
text += fieldText + content[location[0]] + town + "<br>"
|
||||
coordinates = g[field][1]
|
||||
}
|
||||
else if (field=="status") {
|
||||
|
@@ -2,27 +2,38 @@ export let coops = [
|
||||
{
|
||||
logo: "chiron_logo",
|
||||
name: "Chiron Health",
|
||||
location: ["EstoniaKohtlaJarve",[59.40338782864918, 27.286240058760324]],
|
||||
location: [["Estonia","KohtlaJarve"],[59.41038769769602, 27.287802936242034]],
|
||||
market: "wellnessAndHealth",
|
||||
workers: 2,
|
||||
status: "inDevelopment",
|
||||
website: "chrn.health",
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh","WhatsAppInviteLink"],
|
||||
contact: ["https://discord.gg/xAPZmyr8B6","DiscordInviteLink"],
|
||||
description: "descriptionChironHealth"
|
||||
},
|
||||
{
|
||||
logo: "kuusk_logo",
|
||||
name: "Kuusk",
|
||||
location: ["EstoniaKohtlaJarve",[59.405466538976185, 27.289104862336302]],
|
||||
location: [["Estonia","KohtlaJarve"],[59.399947051803004, 27.277159931677055]],
|
||||
market: "herbalTeas",
|
||||
workers: 1,
|
||||
status: "inDevelopment",
|
||||
website: "-",
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh","WhatsAppInviteLink"],
|
||||
contact: ["https://discord.gg/xAPZmyr8B6","DiscordInviteLink"],
|
||||
description: "kuuskDescription"
|
||||
}
|
||||
]
|
||||
|
||||
export let coopsByCountry = {}
|
||||
for (let g of coops) {
|
||||
let country = g.location[0][0]
|
||||
if (country in coopsByCountry) {
|
||||
coopsByCountry[country].push(g)
|
||||
}
|
||||
else {
|
||||
coopsByCountry[country] = [g]
|
||||
}
|
||||
}
|
||||
|
||||
export function addMarkersCoops(map,content) {
|
||||
for (let g of coops) {
|
||||
let coordinates
|
||||
@@ -42,7 +53,9 @@ export function addMarkersCoops(map,content) {
|
||||
text += fieldText + "<a href='" + g.website + "' target='_blank' rel=noreferrer>" + g.website + "</a>" + "<br>"
|
||||
}
|
||||
else if (field=="location") {
|
||||
text += fieldText + content[g[field][0]] + "<br>"
|
||||
let location = g[field][0]
|
||||
let town = location[1]=="" ? "" : ", " + content[location[1]]
|
||||
text += fieldText + content[location[0]] + town + "<br>"
|
||||
coordinates = g[field][1]
|
||||
}
|
||||
else if (field=="market" || field=="status" || field=="description") {
|
||||
|
@@ -1,67 +1,134 @@
|
||||
export let groups = [
|
||||
{
|
||||
location: ["CanadaHalifax",[44.65166135030067, -63.59289968306866]],
|
||||
location: [["Canada","Halifax"],[44.65166135030067, -63.59289968306866]],
|
||||
members: 2,
|
||||
contact: ["https://discord.gg/xAPZmyr8B6","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: ["DenmarkCopenhagen",[55.6840661150132, 12.557133959514688]],
|
||||
location: [["Denmark","Copenhagen"],[55.6840661150132, 12.557133959514688]],
|
||||
members: 1,
|
||||
contact: ["https://discord.gg/xAPZmyr8B6","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: ["DenmarkKolding", [55.49261908652738, 9.470268969851743]],
|
||||
location: [["Denmark","Kolding"], [55.49261908652738, 9.470268969851743]],
|
||||
members: 1,
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh","WhatsAppInviteLink"]
|
||||
contact: ["https://discord.gg/xAPZmyr8B6","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: ["EstoniaKohtlaJarve", [59.40629447076191, 27.280605339416322]],
|
||||
location: [["Estonia","KohtlaJarve"], [59.40629447076191, 27.280605339416322]],
|
||||
members: 3,
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh","WhatsAppInviteLink"]
|
||||
contact: ["https://discord.gg/xAPZmyr8B6","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: ["GreeceAthens", [37.94877252621736, 23.677622972996158]],
|
||||
location: [["Greece","Athens"], [37.94877252621736, 23.677622972996158]],
|
||||
members: 1,
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh","WhatsAppInviteLink"]
|
||||
contact: ["https://discord.gg/xAPZmyr8B6","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: ["Ireland", [53.280192832733576, -7.688103518964818]],
|
||||
location: [["Ireland",""], [53.280192832733576, -7.688103518964818]],
|
||||
members: 6,
|
||||
contact: ["https://discord.gg/4BUau4AZre","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: ["LatviaRiga", [56.94748425529816, 24.003027136431925]],
|
||||
location: [["Latvia","Riga"], [56.94748425529816, 24.003027136431925]],
|
||||
members: 2,
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh","WhatsAppInviteLink"]
|
||||
contact: ["https://discord.gg/xAPZmyr8B6","DiscordInviteLink"]
|
||||
},
|
||||
]
|
||||
|
||||
export let groupsByCountry = {}
|
||||
for (let g of groups) {
|
||||
let country = g.location[0][0]
|
||||
if (country in groupsByCountry) {
|
||||
groupsByCountry[country].push(g)
|
||||
}
|
||||
else {
|
||||
groupsByCountry[country] = [g]
|
||||
}
|
||||
}
|
||||
|
||||
let groupsLoaded = false
|
||||
let groupsMarkersLayerOut = L.layerGroup()
|
||||
let groupsMarkersLayerIn = L.layerGroup()
|
||||
|
||||
let contactGeneral =["https://discord.gg/4BUau4AZre","DiscordInviteLink"]
|
||||
|
||||
function addMarkerGroups(g,layer,content) {
|
||||
let coordinates
|
||||
let text = ""
|
||||
for (let field in g) {
|
||||
let fieldText = content[field] + ": "
|
||||
if (field=="contact") {
|
||||
text += fieldText + "<a href='" + g.contact[0] + "' target='_blank' rel=noreferrer>" + content[g.contact[1]] + "</a>"
|
||||
}
|
||||
else if (field=="location") {
|
||||
let location = g[field][0]
|
||||
let town = location[1]=="" ? "" : ", " + content[location[1]]
|
||||
text += fieldText + content[location[0]] + town + "<br>"
|
||||
coordinates = g[field][1]
|
||||
}
|
||||
else {
|
||||
text += fieldText + g[field] + "<br>"
|
||||
}
|
||||
}
|
||||
var markerIcon = new L.Icon({
|
||||
iconUrl: 'https://www.libsoc.org/img/common/markers/marker-green.png',
|
||||
shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png',
|
||||
iconSize: [25, 41],
|
||||
iconAnchor: [12, 41],
|
||||
popupAnchor: [1, -34],
|
||||
shadowSize: [41, 41]
|
||||
})
|
||||
let marker = L.marker(coordinates, {icon: markerIcon})
|
||||
marker.addTo(layer).bindPopup(text)
|
||||
}
|
||||
|
||||
export function addMarkersGroups(map,content) {
|
||||
for (let g of groups) {
|
||||
let coordinates
|
||||
let text = ""
|
||||
for (let field in g) {
|
||||
let fieldText = content[field] + ": "
|
||||
if (field=="contact") {
|
||||
text += fieldText + "<a href='" + g.contact[0] + "' target='_blank' rel=noreferrer>" + content[g.contact[1]] + "</a>"
|
||||
}
|
||||
else if (field=="location") {
|
||||
text += fieldText + content[g[field][0]] + "<br>"
|
||||
coordinates = g[field][1]
|
||||
}
|
||||
else {
|
||||
text += fieldText + g[field] + "<br>"
|
||||
}
|
||||
addMarkerGroups(g,groupsMarkersLayerIn,content)
|
||||
}
|
||||
for (let gs of Object.values(groupsByCountry)) {
|
||||
if (gs.length==1) {
|
||||
let g = {...gs[0]}
|
||||
g.location[0][1] = ""
|
||||
addMarkerGroups(g,groupsMarkersLayerOut,content)
|
||||
}
|
||||
var markerIcon = new L.Icon({
|
||||
iconUrl: 'https://www.libsoc.org/img/common/markers/marker-green.png',
|
||||
shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png',
|
||||
iconSize: [25, 41],
|
||||
iconAnchor: [12, 41],
|
||||
popupAnchor: [1, -34],
|
||||
shadowSize: [41, 41]
|
||||
});
|
||||
let marker = L.marker(coordinates, {icon: markerIcon})
|
||||
marker.addTo(map).bindPopup(text)
|
||||
else {
|
||||
let locationName = [gs[0].location[0][0],""]
|
||||
let locationCoordinates = [0,0]
|
||||
let members = 0
|
||||
let contact = gs[0].contact
|
||||
for (let g of gs) {
|
||||
locationCoordinates[0] += g.location[1][0]
|
||||
locationCoordinates[1] += g.location[1][1]
|
||||
members += g.members
|
||||
if (g.contact[0]!=gs[0].contact[0]) {
|
||||
contact = contactGeneral
|
||||
}
|
||||
}
|
||||
locationCoordinates[0] = locationCoordinates[0]/gs.length
|
||||
locationCoordinates[1] = locationCoordinates[1]/gs.length
|
||||
let gNew = {
|
||||
location: [locationName,locationCoordinates],
|
||||
members: members,
|
||||
contact: contact
|
||||
}
|
||||
|
||||
addMarkerGroups(gNew,groupsMarkersLayerOut,content)
|
||||
}
|
||||
}
|
||||
groupsMarkersLayerOut.addTo(map)
|
||||
map.on("zoomend", () => onZoomEnd(map))
|
||||
}
|
||||
|
||||
function onZoomEnd(map) {
|
||||
let zoomLevel = map.getZoom()
|
||||
if (zoomLevel==3) {
|
||||
map.removeLayer(groupsMarkersLayerIn)
|
||||
groupsMarkersLayerOut.addTo(map)
|
||||
}
|
||||
else if (zoomLevel==4) {
|
||||
map.removeLayer(groupsMarkersLayerOut)
|
||||
groupsMarkersLayerIn.addTo(map)
|
||||
}
|
||||
}
|
@@ -96,8 +96,13 @@ export function loadLocaleContent(content,componentName,loaded,callback) {
|
||||
if (callback!=undefined) {
|
||||
callback(parsed)
|
||||
}
|
||||
content.set(parsed)
|
||||
loaded = 1
|
||||
content.update((obj) => {
|
||||
Object.assign(obj,parsed)
|
||||
return obj
|
||||
})
|
||||
loaded.update((val) => {
|
||||
return val + 1
|
||||
})
|
||||
})
|
||||
return locale
|
||||
}
|
@@ -2,13 +2,24 @@ export let parties = [
|
||||
{
|
||||
logo: "roots",
|
||||
name: "Roots",
|
||||
location: ["ireland",[52.98479517270413, -7.649233227534782]],
|
||||
location: ["Ireland",[52.98479517270413, -7.649233227534782]],
|
||||
//members: 6,
|
||||
link: "https://discord.gg/pSTMacJZsK",
|
||||
description: "descriptionRoots"
|
||||
}
|
||||
]
|
||||
|
||||
export let partiesByCountry = {}
|
||||
for (let g of parties) {
|
||||
let country = g.location[0]
|
||||
if (country in partiesByCountry) {
|
||||
partiesByCountry[country].push(g)
|
||||
}
|
||||
else {
|
||||
partiesByCountry[country] = [g]
|
||||
}
|
||||
}
|
||||
|
||||
export function addMarkersParties(map,content) {
|
||||
for (let g of parties) {
|
||||
let coordinates
|
||||
|
@@ -2,8 +2,20 @@ export let partners = [
|
||||
{
|
||||
name: "Gaia's Fall",
|
||||
type: "typeGaiasFall",
|
||||
location: [["Online",""],[0,0]],
|
||||
link: "https://discord.libsoc.org/invite/",
|
||||
description: "descriptionGaiasFall",
|
||||
logo: "gaias_fall"
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
export let partnersByCountry = {}
|
||||
for (let g of partners) {
|
||||
let country = g.location[0][0]
|
||||
if (country in partnersByCountry) {
|
||||
partnersByCountry[country].push(g)
|
||||
}
|
||||
else {
|
||||
partnersByCountry[country] = [g]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user