瀏覽代碼

HUE-4562 [editor] Switching to marker map makes the page freeze

Enrico Berti 9 年之前
父節點
當前提交
014aa88
共有 2 個文件被更改,包括 5 次插入4 次删除
  1. 1 2
      desktop/core/src/desktop/conf.py
  2. 4 2
      desktop/core/src/desktop/static/desktop/js/ko.charts.js

+ 1 - 2
desktop/core/src/desktop/conf.py

@@ -194,7 +194,7 @@ SECURE_CONTENT_SECURITY_POLICY = Config(
   help=_('X-Content-Type-Options: nosniff This is a HTTP response header feature that helps prevent attacks based on MIME-type confusion.'),
   type=str,
   default="script-src 'self' 'unsafe-inline' 'unsafe-eval' *.google-analytics.com *.doubleclick.net *.mathjax.org data:;"+
-          "img-src 'self' *.google-analytics.com *.doubleclick.net data:;"+
+          "img-src 'self' *.google-analytics.com *.doubleclick.net *.tile.osm.org data:;"+
           "style-src 'self' 'unsafe-inline';"+
           "connect-src 'self';"+
           "child-src 'none';"+
@@ -329,7 +329,6 @@ LEAFLET_TILE_LAYER = Config(
 LEAFLET_TILE_LAYER_ATTRIBUTION = Config(
   key="leaflet_tile_layer_attribution",
   help=_("The copyright message for the specified Leaflet maps Tile Layer"),
-  type=coerce_str_lowercase,
   default='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors')
 
 POLL_ENABLED = Config(

+ 4 - 2
desktop/core/src/desktop/static/desktop/js/ko.charts.js

@@ -503,10 +503,12 @@
             });
 
             window.setTimeout(function(){
-              _map.addLayer(_clusterGroup);
-              if (! $("#command" + $(element).parents(".card-widget").attr("id")).is(":checked")) {
+              if (!$("#command" + $(element).parents(".card-widget").attr("id")).is(":checked")) {
                 _map.fitBounds(_clusterGroup.getBounds());
               }
+              if ($(element).find('.leaflet-tile-pane').children().length > 0) {
+                _map.addLayer(_clusterGroup);
+              }
               if (_options.onComplete != null) {
                 _options.onComplete();
               }