From c68a0bb8412f261b535d8cebb4b533cdc7b148e7 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 5 Feb 2019 17:05:34 +0100 Subject: Map: optimize query tretment too manage large results --- ishtar_common/static/js/ishtar-map.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ishtar_common/static/js') diff --git a/ishtar_common/static/js/ishtar-map.js b/ishtar_common/static/js/ishtar-map.js index 1488d8fcd..4045d952f 100644 --- a/ishtar_common/static/js/ishtar-map.js +++ b/ishtar_common/static/js/ishtar-map.js @@ -152,14 +152,15 @@ var click_on_feature = function(feature){ if (typeof feature == 'undefined'){ current_feature = null; + $(popup_item).hide(); return; } if (current_feature == feature){ + $(popup_item).hide(); return } current_feature = feature; if (!feature) return; - $(popup_item).hide(); var timeout = 200; setTimeout(function(){ @@ -271,7 +272,8 @@ var _display_items = function(features, offset_x, offset_y){ } var feat = features[idx_feat]; var properties = feat.getProperties(); - popup_content += "
  • " + properties['link'] + " " + properties['name'] + "
  • " + var link = link_template.replace("", properties["id"]); + popup_content += "
  • " + link + " " + properties['name'] + "
  • " } popup_content += ""; $(popup_item).html(popup_content); @@ -330,6 +332,7 @@ var proj_options = { } var geojson_format = new ol.format.GeoJSON(proj_options); var wkt_format = new ol.format.WKT(proj_options); +var link_template; var initialize_base_map = function(layers){ center = wkt_format.readGeometry(map_default_center).getCoordinates(); @@ -360,6 +363,7 @@ var redraw_map = function(layers){ var display_map = function(current_map_id, points, layers){ + link_template = points['link_template']; map_id = current_map_id; if (map){ redraw_map(layers); -- cgit v1.2.3