diff options
Diffstat (limited to 'ishtar_common/static/js/ishtar.js')
-rw-r--r-- | ishtar_common/static/js/ishtar.js | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js index e59ce4f2c..2a2b4fa9f 100644 --- a/ishtar_common/static/js/ishtar.js +++ b/ishtar_common/static/js/ishtar.js @@ -1456,29 +1456,27 @@ var register_map = function(map_id, result){ } $(".search_button").click(); }); - if (points){ - var lbl = ""; - if (points['features'].length){ - lbl += displayed_map_msg.format( - number_with_commas(points['features'].length) - ); - } - if (points['no-geo'].length){ - if (points['features'].length){ - lbl += " - "; + if (points || line_and_polys){ + let lbl = ""; + let feature_nb = 0; + if (points && points['features'].length) feature_nb = points['features'].length; + if (line_and_polys && line_and_polys['features'].length) feature_nb += line_and_polys['features'].length; + + if (feature_nb > 0) lbl += displayed_map_msg.format(number_with_commas(feature_nb)); + if (result['no-geo'].length){ + if (lbl != ""){ + lbl += "<br>"; } - lbl += non_displayed_map_msg.format( - number_with_commas(points['no-geo'].length) - ); + lbl += non_displayed_map_msg.format(number_with_commas(result['no-geo'].length)); lbl += " <a href='#' id='no-geo-" + map_id + "'>" + non_displayed_map_link_msg + "</a>"; } $("#ishtar-map-info-" + map_id).html(lbl); no_geo_window_content = "<ul>"; - for (var idx in points['no-geo']){ - no_geo = points['no-geo'][idx]; - var link = link_template[map_id].replace("<pk>", no_geo["id"]); - var txt = "<li>" + link + " " + no_geo['name'] + "</li>"; + for (const idx in result['no-geo']){ + no_geo = result['no-geo'][idx]; + let link = link_template[map_id].replace("<pk>", no_geo["id"]); + let txt = "<li>" + link + " " + no_geo['name'] + "</li>"; no_geo_window_content += txt; } no_geo_window_content += "</ul>"; |