export let communities = [
{
location: ["EstoniaKohtlaJarve",[59.409521829709504, 27.288415912535914]],
status: "forming",
members: 2,
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh","WhatsAppInviteLink"]
}
]
export function addMarkersCommunities(map,content) {
for (let g of communities) {
let coordinates
let text = ""
for (let field in g) {
let fieldText = content[field] + ": "
if (field=="contact") {
text += fieldText + "" + content[g.contact[1]]+ ""
}
else if (field=="location") {
text += fieldText + content[g[field][0]]+ "
"
coordinates = g[field][1]
}
else if (field=="status") {
text += fieldText + content[g[field]] + "
"
}
else {
text += fieldText + g[field] + "
"
}
}
var greenIcon = new L.Icon({
iconUrl: 'https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.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: greenIcon})
marker.addTo(map).bindPopup(text)
}
}