]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/history.js
Changeset boundary is enlarged if it was on a single point
[rails.git] / app / assets / javascripts / index / history.js
index d54928eb812c1ac8f8f54bf93b75f948e6365f1c..71a94aef0d1ca014d446fa59c8a4ebeaa74c4038 100644 (file)
@@ -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);
       }
     });