Yahoo fixes
authorRichard Fairhurst <richard@systemed.net>
Thu, 2 Sep 2010 21:14:15 +0000 (21:14 +0000)
committerRichard Fairhurst <richard@systemed.net>
Thu, 2 Sep 2010 21:14:15 +0000 (21:14 +0000)
TODO.txt
net/systemeD/halcyon/Map.as
net/systemeD/potlatch2/Yahoo.as

index 3a3e3c0..a6a2204 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -32,8 +32,6 @@ Potlatch 2: main outstanding issues
 * backspaceNode leaves junctions on other ways highlighted
 * GPS loading should have a loading... label
 * Pressing undo/redo sometimes doesn't change controllerstate. (e.g. create POI + undo leaves the tag panel still referring to POI)
-* Resizing window doesn't update Yahoo, until map is panned.
-* Small window -> yahoo -> mapnik -> big window -> yahoo leave yahoo layer borked.
 * Can't use + for second tag
 
 == Miscellaneous data model ==
index a48f9e2..b9abe28 100755 (executable)
@@ -207,10 +207,11 @@ package net.systemeD.halcyon {
                // Resize map size based on current stage and height
 
                public function updateSize(w:uint, h:uint):void {
+                       mapwidth = w; centre_lon=coord2lon(-x+w/2);
+                       mapheight= h; centre_lat=coord2lat(-y+h/2);
+
                        this.dispatchEvent(new MapEvent(MapEvent.RESIZE, {width:w, height:h}));
                        
-                       mapwidth = w;
-                       mapheight= h;
             if ( backdrop != null ) {
                 backdrop.width=mapwidth;
                 backdrop.height=mapheight;
index bafcd5d..6e0cefb 100644 (file)
@@ -34,7 +34,10 @@ package net.systemeD.potlatch2 {
                
                public function show():void {
                        visible=enabled=true;
-                       if (inited) { moveto(map.centre_lat, map.centre_lon, map.scale); }
+                       if (inited) { 
+                               moveto(map.centre_lat, map.centre_lon, map.scale);
+                               this.setSize(map.mapwidth,map.mapheight);
+                       }
 
                        map.addEventListener(MapEvent.MOVE, moveHandler);
                        map.addEventListener(MapEvent.RESIZE, resizeHandler);
@@ -69,8 +72,9 @@ package net.systemeD.potlatch2 {
                        this.zoomLevel=18-scale;
                        this.centerLatLon=new LatLon(lat+offset_lat, lon+offset_lon);
                }
-
+               
                private function resizeHandler(event:MapEvent):void {
+                       moveto(map.centre_lat, map.centre_lon, map.scale);
                        this.setSize(event.params.width, event.params.height);
                }