2014-04-28 00:33:21 +02:00
|
|
|
$(document).ready ->
|
2014-08-23 16:59:42 +02:00
|
|
|
$('.maps #map').each ->
|
2014-07-31 19:34:56 +02:00
|
|
|
map = L.map('map').setView [46.5, 4], 6
|
2014-07-31 01:32:47 +02:00
|
|
|
|
2014-08-02 15:51:45 +02:00
|
|
|
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png',
|
2014-08-23 16:59:42 +02:00
|
|
|
attribution: '© <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
|
|
|
|
|
|
|
|
|
2014-08-25 11:12:22 +02:00
|
|
|
$('.events #map, .moderations #map').each ->
|
2014-08-23 16:59:42 +02:00
|
|
|
coord = [$(this).attr('latitude'), $(this).attr('longitude')]
|
2014-08-02 15:51:45 +02:00
|
|
|
|
2014-08-23 16:59:42 +02:00
|
|
|
map = L.map('map').setView [coord[0], coord[1]], 16
|
|
|
|
|
|
|
|
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png',
|
|
|
|
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a>'
|
2014-07-31 01:32:47 +02:00
|
|
|
).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
|
2014-08-23 16:59:42 +02:00
|
|
|
|
|
|
|
marker = L.marker([coord[0], coord[1]]).addTo map
|