2014-04-28 00:33:21 +02:00
|
|
|
$(document).ready ->
|
2014-06-25 13:47:56 +02:00
|
|
|
if $('#map').size() > 0
|
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',
|
|
|
|
#L.tileLayer('http://{s}.tile.cloudmade.com/{key}/{styleId}/256/{z}/{x}/{y}.png',
|
|
|
|
#L.tileLayer('http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpeg',
|
|
|
|
#attribution: 'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> — Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
|
|
|
|
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors',
|
|
|
|
#subdomains: '1234'
|
|
|
|
|
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
|