Use the name supplied in the config file for the vector layer
[potlatch2.git] / net / systemeD / potlatch2 / utils / BugLoader.as
index ac4cb1a70bb7c68070ff59c049cec99ba4a8ebfc..17b2b880a5558004b403009115aab1243415ab61 100644 (file)
@@ -14,13 +14,15 @@ package net.systemeD.potlatch2.utils {
         private var bugBaseURL:String;
         private var bugApiKey:String;
         private var _layer:VectorLayer;
+        private var name:String;
         private static const STYLESHEET:String="bugs.css";
 
 
-        public function BugLoader(map:Map, url:String, bugApiKey:String):void {
+        public function BugLoader(map:Map, url:String, bugApiKey:String, name:String):void {
             this.map = map;
             this.bugBaseURL = url;
             this.bugApiKey = bugApiKey;
+            this.name = name;
         }
 
         public function load():void {
@@ -30,12 +32,11 @@ 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);
+                _layer=new BugLayer(name,map,STYLESHEET,bugBaseURL,bugApiKey);
                 map.addVectorLayer(_layer);
             }
             return _layer;