add dimming control
authorRichard Fairhurst <richard@systemed.net>
Sat, 5 Dec 2009 19:28:56 +0000 (19:28 +0000)
committerRichard Fairhurst <richard@systemed.net>
Sat, 5 Dec 2009 19:28:56 +0000 (19:28 +0000)
net/systemeD/halcyon/TileSet.as
potlatch2.mxml

index fb13c2cb14525a02eade0aa03f3c16635e8d9f99..3c979d2da5437b134d9ba30fcfcb790da68bb958 100755 (executable)
@@ -27,6 +27,7 @@ package net.systemeD.halcyon {
 
         public function TileSet(map:Map) {
                        this.map=map;
+                       alpha=0.5;
                        createSprites();
                }
        
@@ -44,6 +45,10 @@ package net.systemeD.halcyon {
                        }
                }
 
+               public function setDimming(dim:Boolean):void {
+                       alpha=dim ? 0.5 : 1;
+               }
+
                public function changeScale(scale:uint):void {
                        for (var i:uint=map.MINSCALE; i<=map.MAXSCALE; i++) {
                                this.getChildAt(i-map.MINSCALE).visible=(scale==i);
@@ -93,7 +98,7 @@ package net.systemeD.halcyon {
                                        Sprite(l).addChild(loader);
                                        loader.x=map.lon2coord(tile2lon(tx));
                                        loader.y=map.lat2coord(tile2lat(ty));
-                                       loader.alpha=0.5;
+//                                     loader.alpha=0.5;
                                }
                        }
                }
index 999930ac561e75c0631719aeb9ff12b2b16b4c67..234c95795f615e63a5dc558b0f774f2e0f29edb3 100755 (executable)
@@ -52,7 +52,6 @@
 
                <!-- Background -->
                <mx:VBox label="Background" width="100%">
-               <!-- Needs a dimming checkbox control -->
            <mx:List width="100%" height="100%" id="background" change="updateBackground();"> 
                        <!-- This should be pulled in from an XML file rather than sitting in the source -->
                <mx:dataProvider>
@@ -62,6 +61,7 @@
                    <mx:Object label="OpenCycleMap" data="http://andy.sandbox.cloudmade.com/tiles/cycle/$z/$x/$y.png" />
                </mx:dataProvider>
            </mx:List>
+               <mx:CheckBox width="100%" label="Dim background" selected="true" id="dim" change="theMap.tileset.setDimming(dim.selected); yahoo.alpha = dim.selected ? 0.5 : 1" />
                </mx:VBox>
 
        </mx:Accordion>
                        yahoo.mapType="satellite";
                        _root.addChild(yahoo);
                        yahoo.visible=false;
+                       yahoo.alpha=0.5;
 
                        // Yahoo! listeners
                        yahooListener.yahooInit=function(event:YahooMapEvent):void {