La carte prend maintenant en compte les éventuels paramètres comme tag ou region
This commit is contained in:
parent
aeefcd4048
commit
e078cfefec
@ -6,7 +6,7 @@ $(document).ready ->
|
|||||||
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a>'
|
attribution: '© <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: '© <a href="http://osm.org/copyright">OpenStreetMap</a>'
|
attribution: '© <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?
|
||||||
|
@ -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
|
||||||
|
@ -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}")
|
||||||
|
Loading…
Reference in New Issue
Block a user