diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-03-16 17:18:53 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-03-16 17:18:53 +0100 |
commit | 4da7080cbb0eb0b47182abe34b43f8c9f346fb80 (patch) | |
tree | 3433f3f570cb20a0175a2d94000880b16d1b1703 | |
parent | 4a0e5d8f50d6e1d4b6058b6aeee263b654e3afb4 (diff) | |
download | Chimère-4da7080cbb0eb0b47182abe34b43f8c9f346fb80.tar.bz2 Chimère-4da7080cbb0eb0b47182abe34b43f8c9f346fb80.zip |
Fix permalink initialization
-rw-r--r-- | chimere/static/chimere/js/jquery.chimere.js | 28 | ||||
-rw-r--r-- | version.py | 2 |
2 files changed, 20 insertions, 10 deletions
diff --git a/chimere/static/chimere/js/jquery.chimere.js b/chimere/static/chimere/js/jquery.chimere.js index 098e595..84205a8 100644 --- a/chimere/static/chimere/js/jquery.chimere.js +++ b/chimere/static/chimere/js/jquery.chimere.js @@ -721,8 +721,10 @@ function transformCoordToLonLat(coord) { if (!settings[map_id].edition){ methods.loadCategories(map_id, function(){ if (settings[map_id].permalink) { + settings[map_id]._map_loaded = false; post_load_helper = methods._param_map_from_permalink(map_id); + settings[map_id]._map_loaded = true; } methods.loadGeoObjects(map_id, post_load_helper); }); @@ -908,6 +910,7 @@ function transformCoordToLonLat(coord) { return settings[map_id].permalink }, _param_map_from_permalink: function(map_id){ + // console.log("param_map_from_permalink"); var items = settings[map_id].permalink.split(';'); var view = settings[map_id].map.getView(); @@ -951,8 +954,9 @@ function transformCoordToLonLat(coord) { var cat_id = $(this).attr('id').split('_').pop(); if (checked_categories.indexOf(cat_id) != -1){ $(this).click(); + $(this).prop('checked', true); } else { - $(this).attr('checked', ''); + $(this).prop('checked', false); } }); } @@ -1001,12 +1005,15 @@ function transformCoordToLonLat(coord) { var current_feature = items[4]; var post_load_helper = function(){ - if (current_feature){ - methods._showPopup(map_id, current_feature); - } - settings[map_id].layerDbFeatures.dispatchEvent('change'); - settings[map_id].clusterLayer.dispatchEvent('change'); - settings[map_id].map.render(); + // have to wait for something - but cannot figure what... + setTimeout(function(){ + if (current_feature){ + methods._showPopup(map_id, current_feature); + } + settings[map_id].layerDbFeatures.dispatchEvent('change'); + settings[map_id].clusterLayer.dispatchEvent('change'); + settings[map_id].map.render(); + }, 500); } if (current_feature != "" || routing_start != "" @@ -1645,9 +1652,11 @@ function transformCoordToLonLat(coord) { loadGeoObjects: function (map_id, post_load_helper) { if($('#waiting').length){$('#waiting').show();} if (!settings[map_id]._map_loaded){ + // console.log("loadGeoObjects - requested"); settings[map_id]._load_geoobjects_requested = true; return; } + // console.log("loadGeoObjects - launched"); settings[map_id]._load_geoobjects_requested = false; helpers.retrieve_checked_categories(map_id); @@ -1695,8 +1704,9 @@ function transformCoordToLonLat(coord) { //OL3 methods.addMultiLine(feature); } } - if (typeof post_load_helper != 'undefined') - post_load_helper(); + if (typeof post_load_helper != 'undefined'){ + post_load_helper(); + } // var extent = settings[map_id].sourceDbFeatures.getExtent(); // settings[map_id].map.getView().fit(extent, settings[map_id].map.getSize()); // settings[map_id].map.resetLayersZIndex(); @@ -1,4 +1,4 @@ -VERSION = (3, 1, 6) +VERSION = (3, 1, 7) def get_version(): |