From 9bf489a0b90f80a9be2dab78896950a4da7d0fc2 Mon Sep 17 00:00:00 2001 From: J Guthrie Date: Tue, 2 Oct 2018 23:56:42 +0100 Subject: [PATCH] Changeset boundary is enlarged if it was on a single point --- app/assets/javascripts/index/history.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/index/history.js b/app/assets/javascripts/index/history.js index d54928eb8..71a94aef0 100644 --- a/app/assets/javascripts/index/history.js +++ b/app/assets/javascripts/index/history.js @@ -97,9 +97,17 @@ OSM.History = function(map) { $("[data-changeset]").each(function () { var changeset = $(this).data('changeset'); if (changeset.bbox) { + var latModifier = 0; + var lonModifier = 0; + + if (changeset.bbox.minlat === changeset.bbox.maxlat || changeset.bbox.minlon === changeset.bbox.maxlon) { + latModifier = 0.0001; + lonModifier = 0.0002; + } + changeset.bounds = L.latLngBounds( - [changeset.bbox.minlat, changeset.bbox.minlon], - [changeset.bbox.maxlat, changeset.bbox.maxlon]); + [changeset.bbox.minlat - latModifier, changeset.bbox.minlon - lonModifier], + [changeset.bbox.maxlat + latModifier, changeset.bbox.maxlon + lonModifier]); changesets.push(changeset); } }); -- 2.39.5