X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7e7ede890e8e948236d3dbc48e24aca00cd01f62..bb4720f09b42749746151dae1d0348f062696574:/app/helpers/changesets_helper.rb diff --git a/app/helpers/changesets_helper.rb b/app/helpers/changesets_helper.rb index ae953c583..4605658f6 100644 --- a/app/helpers/changesets_helper.rb +++ b/app/helpers/changesets_helper.rb @@ -41,4 +41,20 @@ module ChangesetsHelper t "changesets.index.title" end end + + def changeset_data(changeset) + changeset_data = { :id => changeset.id } + + if changeset.bbox_valid? + bbox = changeset.bbox.to_unscaled + changeset_data[:bbox] = { + :minlon => bbox.min_lon, + :minlat => bbox.min_lat, + :maxlon => bbox.max_lon, + :maxlat => bbox.max_lat + } + end + + changeset_data + end end