diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-02-05 19:03:48 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-04-24 19:38:56 +0200 | 
| commit | a6109ba4e50a94f1199fd2bbbce330bbf2efd1bc (patch) | |
| tree | b280aa2a4e992946721db25257e01181e5c18039 /ishtar_common/static/js | |
| parent | 950cb59825ae15830b27b4a1a996eaf77b1d04cc (diff) | |
| download | Ishtar-a6109ba4e50a94f1199fd2bbbce330bbf2efd1bc.tar.bz2 Ishtar-a6109ba4e50a94f1199fd2bbbce330bbf2efd1bc.zip  | |
Map JS: replace popup after display
Diffstat (limited to 'ishtar_common/static/js')
| -rw-r--r-- | ishtar_common/static/js/ishtar-map.js | 14 | 
1 files changed, 9 insertions, 5 deletions
diff --git a/ishtar_common/static/js/ishtar-map.js b/ishtar_common/static/js/ishtar-map.js index 78c02adca..2a64d321e 100644 --- a/ishtar_common/static/js/ishtar-map.js +++ b/ishtar_common/static/js/ishtar-map.js @@ -102,16 +102,16 @@ var enable_clustering = function(){      _styleCache = {}; -    // Cluster Source +    // cluster Source      cluster_source = new ol.source.Cluster({          distance: 40,          source: new ol.source.Vector()      }); -    // Animated cluster layer +    // animated cluster layer      cluster_layer = new ol.layer.Vector({          name: 'Cluster',          source: cluster_source, -        // Cluster style +        // cluster style          style: cluster_get_style      });      map.addLayer(cluster_layer); @@ -204,7 +204,7 @@ var click_on_cluster = function(feature, zoom_level, duration, nb_zoom,      if (!zoom_level) zoom_level = v.getZoom() + 1;      // center -    var new_center = feature.getGeometry().getCoordinates() +    var new_center = feature.getGeometry().getCoordinates();      // max zoom reached      if (zoom_level >= min_auto_zoom_on_cluster){          animate_in_progress = true; @@ -299,8 +299,12 @@ var _display_items = function(features, offset_x, offset_y){      $(popup_item).html(popup_content);      $(".map-list-detail").click(open_map_window);      popup.setPosition(geom.getCoordinates()); +    popup.setOffset([offset_x, offset_y]);      $(popup_item).show(function(){ -        popup.setOffset([offset_x, offset_y]); + +        setTimeout(function(){ +            popup.setOffset([offset_x, offset_y]); +        }, 200);      });  };  | 
