diff options
author | Quentin André <quentin.andre@imt-atlantique.net> | 2021-07-26 18:41:53 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-07-08 09:58:48 +0200 |
commit | 993e30819f16a7ac0a55090095b9924407cf95d9 (patch) | |
tree | 50cf810937c40eed0d144dfb964308a54c94ef7d /ishtar_common/static/js | |
parent | 4047091001b3afad2520ce305ea69a924cd621d5 (diff) | |
download | Ishtar-993e30819f16a7ac0a55090095b9924407cf95d9.tar.bz2 Ishtar-993e30819f16a7ac0a55090095b9924407cf95d9.zip |
fixes urls import
Diffstat (limited to 'ishtar_common/static/js')
-rw-r--r-- | ishtar_common/static/js/ishtar-map.js | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/ishtar_common/static/js/ishtar-map.js b/ishtar_common/static/js/ishtar-map.js index b22467668..c78da1098 100644 --- a/ishtar_common/static/js/ishtar-map.js +++ b/ishtar_common/static/js/ishtar-map.js @@ -645,7 +645,8 @@ var display_lines_and_polys = function(map_id, lines_and_polys){ } }; -var disp_geo_items = function(map_id, base_url, slug, pk, display_both) { +var disp_geo_items = function(map_id, base_url, slug, pk, + display_both, get_poly) { var url = base_url; if (slug === "operation") { url += "?operation_pk="; @@ -662,10 +663,18 @@ var disp_geo_items = function(map_id, base_url, slug, pk, display_both) { if (httpRequest.status === 200) { geo_items = to_geo_items(JSON.parse(httpRequest.responseText), slug, display_both) for (geo_item of geo_items['base-finds']) { - display_associated_polys(map_id, geo_item, 'basefind'); + if (get_poly) { + display_associated_polys(map_id, geo_item, 'basefind'); + } else { + display_associated_points(map_id, geo_item, 'basefind'); + } } for (geo_item of geo_items['context-records']) { - display_associated_polys(map_id, geo_item, 'contextrecord'); + if (get_poly) { + display_associated_polys(map_id, geo_item, 'contextrecord'); + } else { + display_associated_points(map_id, geo_item, 'contextrecord'); + } } } else { return; } } @@ -727,16 +736,20 @@ var get_associated_context_record_style = function (feature) { }), fill: new ol.style.Fill({ color: 'rgba(255, 255, 255, 0.2)' - }) + }), + radius: 10 }); }; var display_associated_points = function (map_id, points, slug) { + console.log(points); _point_features = geojson_format.readFeatures(points); + console.log(_point_features[0].getGeometry().getType()) _cluster_source = new ol.source.Cluster({ distance: 40, source: new ol.source.Vector() }); + _cluster_source.getSource().addFeatures(_point_features); style = get_associated_base_find_style; if (slug === 'contextrecord') { style = get_associated_context_record_style; @@ -747,5 +760,5 @@ var display_associated_points = function (map_id, points, slug) { style: style }); map[map_id].addLayer(_cluster_layer); - _cluster_source.getSource().addFeatures(_point_features); + }
\ No newline at end of file |