Archived
1
0
Fork 0
This commit is contained in:
Lukas Winkler 2016-10-03 18:03:24 +02:00
parent cbc87c7c82
commit 59cbf3eb4d
2 changed files with 7 additions and 4 deletions

View file

@ -35,6 +35,8 @@ def hello_world():
abort(400)
cur.execute("SELECT id FROM connections WHERE start = %s AND goal = %s", [request.args["from"], request.args["to"]])
result = cur.fetchone()
if not result:
abort(404)
return redirect(url_for("get_connection", connection_id=int(result[0])))

View file

@ -62,7 +62,7 @@
maxZoom: 19,
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
});
var emptyLayer = L.tileLayer("").addTo(map);
var emptyLayer = L.tileLayer("", {maxZoom: 19}).addTo(map);
var citybikeIcon = L.Icon.extend({
options: {
@ -166,7 +166,6 @@
success: function (data) {
lines.addData(data);
lines.addTo(map);
console.log(linesArray);
}
});
}
@ -229,9 +228,11 @@
from: fromId,
to: toId
}).done(function (data) {
lines.addData(data);
var id = data.features[0].properties.id;
lines.getLayer(linesArray[id]["leafletId"]).openPopup();
var bounds = lines.getLayer(linesArray[id]["leafletId"]).getBounds();
map.flyToBounds(bounds);
});
$(".clearButton").on("click", function () {
var allLines = lines.getLayers();