diff options
Diffstat (limited to 'ishtar_common/static')
-rw-r--r-- | ishtar_common/static/js/ishtar-map.js | 8 |
1 files changed, 6 insertions, 2 deletions
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 += "<li>" + properties['link'] + " " + properties['name'] + "</li>" + var link = link_template.replace("<pk>", properties["id"]); + popup_content += "<li>" + link + " " + properties['name'] + "</li>" } popup_content += "</ul>"; $(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); |