A calendar management project, for events and activities related to communities fighting for freedoms.
This can be related to software, art, data, hardware, content, commons, internet.
https://www.agendadulibre.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
1.4 KiB

$(document).ready ->
$('.maps #map').each ->
map = L.map('map').setView [46.5, 4], 6
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png',
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a>'
).addTo map
$.getJSON '/maps.json', (json) ->
points = []
L.geoJson(json,
onEachFeature: (feature, layer) ->
points += [feature.geometry.coordinates[0], feature.geometry.coordinates[1]]
# Does this feature have a property named popupContent?
if (feature.properties && feature.properties.popupContent)
layer.bindPopup(feature.properties.popupContent)
).addTo map
console.log L.bounds(points[0], points[1])
$('.events #map').each ->
coord = [$(this).attr('latitude'), $(this).attr('longitude')]
map = L.map('map').setView [coord[0], coord[1]], 16
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png',
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a>'
).addTo map
$.getJSON '/maps.json', (json) ->
L.geoJson(json,
onEachFeature: (feature, layer) ->
# Does this feature have a property named popupContent?
if (feature.properties && feature.properties.popupContent)
layer.bindPopup(feature.properties.popupContent)
).addTo map
marker = L.marker([coord[0], coord[1]]).addTo map