Commit 2fca8a55 authored by dagal's avatar dagal
Browse files

Sorting stops by name for autocomplete

parent 94e38c85
......@@ -134,6 +134,15 @@ let stopLayer = L.geoJSON(null, {
getty.jsonGet("/stops").then(function (fc) {
stopLayer.addData(fc);
app.stops = fc.features.map(f => f.properties);
app.stops.sort((f1,f2) => {
if (f1.name < f2.name) {
return -1;
} else if (f1.name > f2.name) {
return 1;
} else {
return 0;
}
});
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment