agenda-libre-ruby/app/views/maps/index.json.jbuilder

23 lines
653 B
Plaintext
Raw Normal View History

2019-04-29 18:29:38 +02:00
json.array!(@events) do |e|
json.merge!(
type: 'Feature',
properties: {
2019-04-29 18:29:38 +02:00
id: e.id,
name: e.title,
start_time: e.start_time, end_time: e.end_time,
submission_time: e.submission_time,
decision_time: e.decision_time,
place_name: e.place_name, address: e.address, city: e.city,
region: t(e.region.code.presence ? e.region.code : e.region.name,
scope: :countries, default: e.region.name),
region_id: e.region_id,
tags: e.tag_list,
popupContent: link_to(e, event_url(e))
},
geometry: {
type: 'Point',
2019-04-29 18:29:38 +02:00
coordinates: [e.longitude, e.latitude]
}
)
end