We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea65361 commit 238eadaCopy full SHA for 238eada
web/static/leaflet_script.js
@@ -46,6 +46,9 @@ function setStart() {
46
icon: greenIcon
47
}).addTo(map);
48
map.removeLayer(tmpMarker);
49
+ if (typeof last_path === 'object') {
50
+ map.removeLayer(last_path);
51
+ }
52
}
53
54
function setEnd() {
@@ -61,6 +64,9 @@ function setEnd() {
61
64
icon: redIcon
62
65
63
66
67
68
69
70
71
72
function query() {
@@ -122,6 +128,7 @@ function printPath(path) {
122
128
});
123
129
last_path = L.polyline(points);
124
130
map.addLayer(last_path);
131
+ map.fitBounds(last_path.getBounds().pad(Math.sqrt(2) / 4));
125
132
126
133
127
134
0 commit comments