Commit 375a3081 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

preserver order

parent 52141e49
Pipeline #47687 passed with stage
in 16 minutes and 45 seconds
......@@ -5,6 +5,8 @@ minerva (16.0.0~beta.3) stable; urgency=medium
(#1557)
* Bug fix: issues with exporting map to file or image fixed (#1561, #1560,
#1559)
* Bug fix: sometimes wrong icn numbers were attached to search results
(#1556)
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 27 Sep 2021 08:00:00 +0200
......
......@@ -1151,8 +1151,10 @@ CustomMap.prototype.fetchIdentifiedElements = function (elements, complete) {
var modelIds = [];
var modelElements = [];
var i;
var elementPosition = [];
for (i = 0; i < elements.length; i++) {
var element = elements[i];
elementPosition[element.getId()] = i;
if (modelElements[element.getModelId()] === undefined) {
modelIds.push(element.getModelId());
modelElements[element.getModelId()] = [];
......@@ -1168,7 +1170,10 @@ CustomMap.prototype.fetchIdentifiedElements = function (elements, complete) {
var result = [];
return Promise.all(promises).then(function (data) {
for (var i = 0; i < data.length; i++) {
result.push.apply(result, data[i]);
data[i].forEach(function (element) {
//preserve the order
result[elementPosition[element.getId()]] = element;
});
}
return result;
});
......
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