]> git.openstreetmap.org Git - rails.git/commitdiff
Add padding to directions popups
authorJamie Guthrie <jamie.guthrie@gmail.com>
Tue, 13 Feb 2018 01:28:57 +0000 (01:28 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 13 Feb 2018 17:25:56 +0000 (17:25 +0000)
Clicking on a direction step now pans to the popup, but includes some
padding so that the popup is not hidden in the corner of the screen.

Closes #1745

app/assets/javascripts/index/directions.js

index ce8ac9c1cc432a0e61a081c70f67ab21987b5bf3..165d57f40f9a3b351c1db8d083420ddc231afdb5 100644 (file)
@@ -7,7 +7,7 @@ OSM.Directions = function (map) {
   var dragging;        // true if the user is dragging a start/end point
   var chosenEngine;
 
   var dragging;        // true if the user is dragging a start/end point
   var chosenEngine;
 
-  var popup = L.popup();
+  var popup = L.popup({autoPanPadding: [100, 100]});
 
   var polyline = L.polyline([], {
     color: '#03f',
 
   var polyline = L.polyline([], {
     color: '#03f',