Use public vars for toolbox delete strings so that they can be translated
[potlatch2.git] / halcyon_viewer.as
old mode 100755 (executable)
new mode 100644 (file)
index d0fb05f..3b01b9e
@@ -8,6 +8,7 @@ package {
        import flash.events.MouseEvent;
        import flash.display.*;
        import flash.text.TextField;
+       import flash.external.*;
 //     import bustin.dev.Inspector;
 
        public class halcyon_viewer extends Sprite {
@@ -26,6 +27,7 @@ package {
             theMap.updateSize(stage.stageWidth, stage.stageHeight);
                        addChild(theMap);
                        Globals.vars.root=theMap;
+                       Globals.vars.nocache = loaderInfo.parameters['nocache'] == 'true';
 
                        // add debug field
                        var t:TextField=new TextField();
@@ -33,7 +35,7 @@ package {
                        t.multiline=true;
                        addChild(t);
                        Globals.vars.debug=t;
-                       t.visible = true;
+            t.visible = loaderInfo.parameters["show_debug"] == 'true';
 
                        stage.addEventListener(MouseEvent.MOUSE_UP, theMap.mouseUpHandler);
                        stage.addEventListener(MouseEvent.MOUSE_MOVE, theMap.mouseMoveHandler);
@@ -61,9 +63,21 @@ package {
                var controller:JSController = new JSController(theMap, loaderInfo.parameters['responder']);
                                controller.setActive();
                        }
+
+                       ExternalInterface.addCallback('refreshCSS', onRefreshCSS);
+                       ExternalInterface.addCallback('jumpTo', onJumpTo);
+               }
+
+               private function onRefreshCSS(str:String):void {
+                       theMap.setStyle(str);
+               }               
+               private function onJumpTo(lat:Number,lon:Number):void {
+                       theMap.init(lat,lon);
                }
-               
+
                private function zoomInHandler(e:MouseEvent):void  { e.stopPropagation(); theMap.zoomIn(); }
                private function zoomOutHandler(e:MouseEvent):void { e.stopPropagation(); theMap.zoomOut(); }
+
+
        }
 }