+
+ if (results.remark) {
+ $("<li>")
+ .addClass("list-group-item")
+ .text(I18n.t("javascripts.query.error", { server: url, error: results.remark }))
+ .appendTo($ul);
+ }
+
+ if ($ul.find("li").length === 0) {
+ $("<li>")
+ .addClass("list-group-item")
+ .text(I18n.t("javascripts.query.nothing_found"))
+ .appendTo($ul);
+ }
+ })
+ .catch(function (error) {
+ if (error.name === "AbortError") return;
+
+ $section.find(".loader").hide();
+
+ $("<li>")
+ .addClass("list-group-item")
+ .text(I18n.t("javascripts.query.error", { server: url, error: error.message }))
+ .appendTo($ul);
+ });
+ }
+
+ function compareSize(feature1, feature2) {
+ const width1 = feature1.bounds.maxlon - feature1.bounds.minlon,
+ height1 = feature1.bounds.maxlat - feature1.bounds.minlat,
+ area1 = width1 * height1,
+ width2 = feature2.bounds.maxlat - feature2.bounds.minlat,
+ height2 = feature2.bounds.maxlat - feature2.bounds.minlat,
+ area2 = width2 * height2;
+
+ return area1 - area2;