Select new POIs when they are dropped on the map.
authorTom Hughes <tom@compton.nu>
Wed, 24 Mar 2010 11:29:14 +0000 (11:29 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 24 Mar 2010 11:29:14 +0000 (11:29 +0000)
net/systemeD/potlatch2/EditController.as
potlatch2.mxml

index a42e39f7056c3df23340eb933a7def0362a70c18..6c27dd10d0badf56697b963eeb0d74fbe88d1caa 100644 (file)
@@ -74,7 +74,7 @@ package net.systemeD.potlatch2 {
             setState(newState);
         }
         
-        private function setState(newState:ControllerState):void {
+        public function setState(newState:ControllerState):void {
             if ( newState == state )
                 return;
                 
index 0ed126352b574ea8fb59740d0abbe2b3ca4f9b6b..5a6cdbd9ef910e20b95f7efe690b1a911f44b1ed 100755 (executable)
@@ -57,6 +57,7 @@
                import net.systemeD.halcyon.connection.*;
                import net.systemeD.potlatch2.*;
                import net.systemeD.potlatch2.save.SaveManager;
+               import net.systemeD.potlatch2.controller.*;
                import net.systemeD.potlatch2.help.*;
                import net.systemeD.potlatch2.options.*;
                import net.systemeD.potlatch2.utils.*;
@@ -76,6 +77,7 @@
         import mx.core.DragSource;
 
         public var theMap:Map;
+        public var theController:EditController;
                public var yahooListener:Object = new Object();
                public var yahoo:YahooMap = new YahooMap(); 
 
             t.visible = loaderInfo.parameters["show_debug"] == 'true';
                        Globals.vars.root=theMap;       // just for the addDebug function
 
-            var controller:EditController = new EditController(theMap, tagViewer);
-            controller.setActive();
+            theController = new EditController(theMap, tagViewer);
+            theController.setActive();
             
             var conn:Connection = Connection.getConnectionInstance();
             conn.addEventListener(Connection.LOAD_STARTED, onDataStart);
               node.setTag(tag.k, tag.v);
             }
                        Connection.getConnectionInstance().registerPOI(node);
+            theController.setState(new SelectedPOINode(node));
         }
 
        ]]></mx:Script>