La carte prend maintenant en compte les éventuels paramètres comme tag ou region

This commit is contained in:
echarp 2014-10-27 23:33:47 +01:00
parent aeefcd4048
commit e078cfefec
3 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ $(document).ready ->
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a>' attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a>'
).addTo map ).addTo map
$.getJSON '/maps.json', (json) -> $.getJSON $(this).data('url') + location.search, (json) ->
layer = L.geoJson(json, layer = L.geoJson(json,
onEachFeature: (feature, layer) -> onEachFeature: (feature, layer) ->
# Does this feature have a property named popupContent? # Does this feature have a property named popupContent?
@ -28,7 +28,7 @@ $(document).ready ->
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a>' attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a>'
).addTo map ).addTo map
$.getJSON '/maps.json', (json) -> $.getJSON $(this).data('url') + location.search, (json) ->
layer = L.geoJson(json, layer = L.geoJson(json,
onEachFeature: (feature, layer) -> onEachFeature: (feature, layer) ->
# Does this feature have a property named popupContent? # Does this feature have a property named popupContent?

View File

@ -50,7 +50,7 @@
"http://fr.wikipedia.org/wiki/#{url_encode @event.related_region.try(:name)}" "http://fr.wikipedia.org/wiki/#{url_encode @event.related_region.try(:name)}"
- if @event.latitude && @event.longitude - if @event.latitude && @event.longitude
#map(latitude="#{@event.latitude}" longitude="#{@event.longitude}") #map(data-url="#{maps_path format: :json}" latitude="#{@event.latitude}" longitude="#{@event.longitude}")
- elsif controller.action_name != 'show' - elsif controller.action_name != 'show'
%em.fa.fa-compress %em.fa.fa-compress

View File

@ -2,4 +2,4 @@
%em.fa.fa-map-marker %em.fa.fa-map-marker
=title t '.title' =title t '.title'
#map #map(data-url="#{maps_path format: :json}")