space-drag for backgrounds, plus D to dim (au revoir caps lock)
[potlatch2.git] / net / systemeD / potlatch2 / BackgroundSelector.mxml
1 <?xml version="1.0" encoding="utf-8"?>
2 <mx:VBox
3         xmlns:mx="http://www.adobe.com/2006/mxml"
4         paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"
5         horizontalAlign="left" backgroundColor="white" borderStyle="inset">
6         
7         <mx:List width="100%" height="100%" id="background" change="updateBackground();" verticalScrollPolicy="on"> 
8             <!-- This should be pulled in from an XML file rather than sitting in the source -->
9             <mx:dataProvider>
10                 <mx:Object label="None" data="" />
11                 <mx:Object label="Yahoo!" data="yahoo" />
12             <mx:Object label="OSM - Mapnik" data="http://tile.openstreetmap.org/$z/$x/$y.png" />
13             <mx:Object label="OSM - Osmarender" data="http://tah.openstreetmap.org/Tiles/tile/$z/$x/$y.png" />
14             <mx:Object label="OSM - Maplint (errors)" data="http://tah.openstreetmap.org/Tiles/maplint/$z/$x/$y.png" />
15             <mx:Object label="OpenCycleMap" data="http://andy.sandbox.cloudmade.com/tiles/cycle/$z/$x/$y.png" />
16                         <mx:Object label="UK: OS StreetView" data="http://os.openstreetmap.org/sv/$z/$x/$y.png" />
17             <mx:Object label="UK historic: 1:25k" data="http://ooc.openstreetmap.org/os1/$z/$x/$y.png" />
18             <mx:Object label="UK historic: 7th" data="http://ooc.openstreetmap.org/os7/$z/$x/$y.png" />
19             <mx:Object label="UK historic: NPE" data="http://ooc.openstreetmap.org/npe/$z/$x/$y.png" />
20             <mx:Object label="Australia: NearMap" data="http://www.nearmap.com/maps/nml=Vert&amp;zxy=$z,$x,$y" />
21             </mx:dataProvider>
22         </mx:List>
23         <mx:CheckBox width="100%" label="Dim background" selected="true" id="dim"
24             change="Globals.vars.root.tileset.setDimming(dim.selected); Globals.vars.yahoo.alpha = dim.selected ? 0.5 : 1" />
25
26         <mx:Button label="Load vector file..." click="new VectorSourceDialog().init();"/>
27
28         <mx:Script><![CDATA[
29                 import net.systemeD.halcyon.*;
30                 import net.systemeD.halcyon.connection.*;
31                 import net.systemeD.potlatch2.*;
32                 import mx.core.*;
33                 import mx.managers.PopUpManager;
34
35                 private function updateBackground():void {
36             var theMap:Map = Globals.vars.root;
37                         var bg:String=background.selectedItem.data;
38                         if (bg=='yahoo') {
39                                 theMap.tileset.init('',false);
40                                 Globals.vars.yahoo.show();
41                         } else {
42                                 theMap.tileset.init(background.selectedItem.data,true);
43                                 Globals.vars.yahoo.hide();
44                         }
45                 }
46                 
47
48     ]]></mx:Script>     
49 </mx:VBox>
50