diff options
author | Quentin André <quentin.andre@imt-atlantique.net> | 2021-08-24 21:38:46 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-07-08 09:58:48 +0200 |
commit | 7e4ad702275fccc2772f083e046d31d35c045131 (patch) | |
tree | e1d279e9bbf539714e76632267c784306f7c6f7a /ishtar_common/static/js | |
parent | b2ea40d91efaf82ca03196bf9527383121a9edf7 (diff) | |
download | Ishtar-7e4ad702275fccc2772f083e046d31d35c045131.tar.bz2 Ishtar-7e4ad702275fccc2772f083e046d31d35c045131.zip |
ui tests without base feature point working
Diffstat (limited to 'ishtar_common/static/js')
-rw-r--r-- | ishtar_common/static/js/ishtar-map.js | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/ishtar_common/static/js/ishtar-map.js b/ishtar_common/static/js/ishtar-map.js index 00aadfd9b..ab8096b06 100644 --- a/ishtar_common/static/js/ishtar-map.js +++ b/ishtar_common/static/js/ishtar-map.js @@ -146,9 +146,9 @@ var TrackPositionControl = (function (Control) { if ( Control ) TrackPositionControl.__proto__ = Control; TrackPositionControl.prototype = Object.create( Control && Control.prototype ); - TrackPositionControl.prototype.constructor = TrackPositionControl; + TrackPositionControl.prototype.varructor = TrackPositionControl; - TrackPositionControl.prototype.handleTrackPosition = function handleTrackPosition () { + TrackPositionControl.prototype.handvarrackPosition = function handvarrackPosition () { if (!geolocation[this.map_id]){ set_geoloc_source(this.map_id); } else { @@ -452,7 +452,7 @@ var open_map_window = function(map_id){ }; }; -var complete_list_label = "complete list..."; +var complete_list_label = "compvare list..."; var _display_items = function(map_id, features, offset_x, offset_y){ // console.log("display_items"); @@ -553,13 +553,14 @@ var vector_features = {}; // for test var geo_items_features = null; var current_test = false; -var initialize_test_map = function () { +var initialize_test_map = function (slug_pk) { + var id = "http-geo-items-ready-" + slug_pk; geo_items_features = {}; current_test = true; - if ($("#http-geo-items-ready").length === 0) { - $("#display-geo-items").after('<div id="http-geo-items-ready">Ready!</div>'); + if ($("#"+id).length === 0) { + $("#display-geo-items").after('<div id="'+id+'">Ready!</div>'); } - $("#http-geo-items-ready").hide(); + $("#"+id).hide(); } var initialize_base_map = function(map_id, layers){ @@ -614,17 +615,12 @@ var display_map = function(map_id, points, lines_and_polys, layers){ link_template[map_id] = lines_and_polys['link_template']; } if (map[map_id]){ - redraw_map(map_id, layers); } else { initialize_base_map(map_id, layers); } - //console.log('map init') - //console.log(map[map_id]); display_points(map_id, points); display_lines_and_polys(map_id, lines_and_polys); - //console.log('map after points'); - //console.log(map[map_id]); init_popup(map_id); @@ -637,8 +633,6 @@ var display_map = function(map_id, points, lines_and_polys, layers){ }; var display_points = function(map_id, points){ - //console.log('points'); - //console.log(points); if (!points) return; point_features[map_id] = geojson_format.readFeatures(points); enable_clustering(map_id); @@ -701,7 +695,7 @@ var display_geo_items = function(map_id, base_url, slug, pk, if (current_test) { geo_items_features[map_id].push(bfs) geo_items_features[map_id].push(crs) - $("#http-geo-items-ready").show(); + $("#http-geo-items-ready-"+slug+"-"+pk).show(); } } else { return; } } @@ -872,19 +866,19 @@ var get_map_by_id_test = function (id) { var get_features_by_id = function (id) { if (vector_features[id] == null) { - var base_features = geojson_format.writeFeaturesObject(point_features[id], {decimals: 3}); + var base_features = geojson_format.writeFeaturesObject(point_features[id], {decimals: 5}); } else { - var base_features = geojson_format.writeFeaturesObject(vector_features[id], {decimals: 3}); + var base_features = geojson_format.writeFeaturesObject(vector_features[id], {decimals: 5}); } var geo_items_feats = []; if (geo_items_features && id in geo_items_features) { for (var features of geo_items_features[id]) { - geo_items_feats.push(geojson_format.writeFeaturesObject(features, {decimals: 3})); + geo_items_feats.push(geojson_format.writeFeaturesObject(features, {decimals: 5})); } } return [base_features, geo_items_feats]; } -var print = function (id) { +var base_features_type = function (id) { return "vector " + typeof vector_features[id] + ", cluster " + typeof point_features[id] ; -}
\ No newline at end of file +} |