From f1e91766c76987404e7c26e36081782526525c9e Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 22 Oct 2022 20:40:32 +0200 Subject: [PATCH] [CQ Map] Fix when reloading map after selection change --- application/views/awards/cq/index.php | 4 ++-- assets/js/sections/cqmap.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/application/views/awards/cq/index.php b/application/views/awards/cq/index.php index 45e44fee..e5cd4476 100644 --- a/application/views/awards/cq/index.php +++ b/application/views/awards/cq/index.php @@ -124,13 +124,13 @@ Table
-
+

diff --git a/assets/js/sections/cqmap.js b/assets/js/sections/cqmap.js index 06f6f43b..d374f71b 100644 --- a/assets/js/sections/cqmap.js +++ b/assets/js/sections/cqmap.js @@ -1,7 +1,7 @@ var osmUrl = $('#cqmapjs').attr("tileUrl"); function load_cq_map() { - $('.nav-tabs a[href="#cqmap"]').tab('show'); + $('.nav-tabs a[href="#cqmaptab"]').tab('show'); $.ajax({ url: base_url + 'index.php/awards/cq_map', type: 'post', @@ -110,11 +110,13 @@ function load_cq_map2(data) { [ "78", "-10"], ]; - // If map is already initialized + // If map is already initialized var container = L.DomUtil.get('cqmap'); if(container != null){ container._leaflet_id = null; + container.remove(); + $("#cqmaptab").append('
'); } var map = L.map('cqmap');