Load policy files only when the layer is created - often the loader can be created...
[potlatch2.git] / net / systemeD / potlatch2 / utils / BugLoader.as
index bebd7db7a3b5db0a1cf5bff92d4da9948fc478fd..ac4cb1a70bb7c68070ff59c049cec99ba4a8ebfc 100644 (file)
@@ -21,8 +21,6 @@ package net.systemeD.potlatch2.utils {
             this.map = map;
             this.bugBaseURL = url;
             this.bugApiKey = bugApiKey;
-            var policyFile:String = bugBaseURL+"crossdomain.xml";
-            Security.loadPolicyFile(policyFile);
         }
 
         public function load():void {
@@ -33,6 +31,10 @@ package net.systemeD.potlatch2.utils {
         private function get layer():VectorLayer {
             if (!_layer) {
                 var n:String='Bugs';
+
+                var policyFile:String = bugBaseURL+"crossdomain.xml";
+                Security.loadPolicyFile(policyFile);
+
                 _layer=new BugLayer(n,map,STYLESHEET,bugBaseURL,bugApiKey);
                 map.addVectorLayer(_layer);
             }