Commit bd29d301 authored by Eric Duminil's avatar Eric Duminil
Browse files

Sort citygmls inside project.

parent 942d3f94
......@@ -4,6 +4,7 @@ var regionChooser = (function(){
var fromJavaFX = navigator.userAgent.indexOf('JavaFX') !== -1;
var dataPanel = $('#dataPanel');
var wgs84Sphere = new ol.Sphere(6378137);
var features_by_project;
var gmlId;
publicScope.init = function(){
......@@ -96,6 +97,11 @@ var regionChooser = (function(){
feature["name"] = feature.get("name");
feature["source"] = "CityGML";
});
features_by_project = groupBy(kml_source.getFeatures(), "project");
// Sort CityGMLs inside each project
Object.values(features_by_project).forEach(features => features.sort((a, b) => a.name.localeCompare(b.name)));
}
// The features are not added to a regular vector layer/source,
......@@ -190,8 +196,6 @@ var regionChooser = (function(){
var polygonArea = sketch.getGeometry().getArea();
var intersection_found = false;
intersections.clear();
//NOTE: getFeatures seems to not be sorted anymore. :-/
features_by_project = groupBy(kml_source.getFeatures(), "project");
Object.keys(features_by_project).forEach(function(project) {
features = features_by_project[project];
......@@ -368,7 +372,7 @@ var regionChooser = (function(){
updateGMLPolygons();
displayHelp();
document.documentElement.className = ''; // Stop waiting
console.log("READY!");
console.log("Ready!");
}
publicScope.downloadFromSelectedCityGMLs = function() {
......
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