summaryrefslogtreecommitdiff
path: root/ishtar_common/static/js/ishtar-map.js
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/static/js/ishtar-map.js')
-rw-r--r--ishtar_common/static/js/ishtar-map.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/ishtar_common/static/js/ishtar-map.js b/ishtar_common/static/js/ishtar-map.js
index 4403c7b62..ef2651348 100644
--- a/ishtar_common/static/js/ishtar-map.js
+++ b/ishtar_common/static/js/ishtar-map.js
@@ -29,7 +29,8 @@ var geoloc_activated = {};
var fetching_msg = "Fetching data...";
-var _map_submit_search = function(query_vars, name, source){
+var _map_submit_search = function(query_vars, name, source, extra){
+ if (!extra) extra = "default";
var modal_base_text = $('.modal-progress .modal-header').html();
$('.modal-progress .modal-header').html(fetching_msg);
$('.modal-progress').modal('show');
@@ -45,11 +46,11 @@ var _map_submit_search = function(query_vars, name, source){
}
$.getJSON(url, function(data) {
var timestamp = Math.floor(Date.now() / 1000);
- var map_id = "map-" + timestamp;
+ var map_id = "map-" + extra + "-" + timestamp;
$('.modal-progress .modal-header').html("{% trans 'Render map...' %}");
var html = render_map(map_id, use_map_limit);
- $("#tab-content-map-" + name).html(html);
+ $("#tab-content-map-" + name + " #map-" + name + "-" + extra).html(html);
$("#id_" + name + "-length_map").change(map_submit_search);
if ($('.modal-progress').length > 0){
$('.modal-progress').modal('hide');
@@ -598,6 +599,7 @@ var initialize_base_map = function(map_id, layers){
}
var redraw_map = function(map_id, layers){
+ if (!map || !map[map_id]) return;
map[map_id].setTarget(null);
map[map_id] = null;
initialize_base_map(map_id, layers);
@@ -607,7 +609,6 @@ var redraw_map = function(map_id, layers){
var display_map = function(map_id, points, lines_and_polys, layers){
-
base_color_rvb = base_color_R + ', ' + base_color_V + ', ' + base_color_B;
if (points){