X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/83043d6f1cd85729a3f91e5c73d78a39b8ae7d04..11e0444f363a08a08b730a169f56617cd9885315:/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