Skip to content

Commit 2b28e1b

Browse files
author
stevage
committed
This tiny change fixes #3360 and brings an end to the most confusing debugging session I can recall. So, apparently Yahoo imagery is totally different. I didn't know. We go through the motions of initialising TileSet, and calling it every frame. But it's not doing anything. Why? Because the Yahoo API is actually doing the work. I was staring at the code, thinking "This is bizarre, I swear this code is not actually causing what I'm seeing on the screen...but what is?" Very, very trippy.
Oh yeah, about the bug. The Yahoo initialisation was hard coded to start dimmed. Now it's not. git-svn-id: http://svn.openstreetmap.org/applications/editors/potlatch2@25522 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
1 parent 3a40dd5 commit 2b28e1b

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

net/systemeD/halcyon/TileSet.as

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ package net.systemeD.halcyon {
77
import flash.system.LoaderContext;
88
import flash.utils.Timer;
99

10+
/** This class manages the fetching of tiles for background imagery from compatible servers. When the map is scrolled,
11+
* it works out which tiles are needed, and requests them. When they arrive, they are faded into display.
12+
* Important note: this class is *not* used for Yahoo! imagery. That is handled through the Yahoo and YahooMap classes.
13+
*/
1014
public class TileSet extends Sprite {
1115

1216
public var tile_l:int;
@@ -157,9 +161,9 @@ package net.systemeD.halcyon {
157161

158162
/* We may need something like this in the future, not sure. Trouble is if a tile doesn't get loaded on first go,
159163
it will never get loaded.
160-
private function checkTileLoaded(z,x,y) {
164+
private function checkTileLoaded(z:int,x:int,y:int) {
161165
if (tiles[z+','+x+','+y]==true){
162-
trace("Didn't even start getting tile: " + z+','+x+','+y);
166+
trace("Didn't even start getting tile: " + z+','+x+','+y);
163167
requests.push([z,x,y]);
164168
return;
165169
}

net/systemeD/potlatch2/Yahoo.as

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@ package net.systemeD.potlatch2 {
2121
private var inited:Boolean;
2222
private var enabled:Boolean;
2323

24-
public function Yahoo(w:Number, h:Number, map:Map) {
24+
public function Yahoo(w:Number, h:Number, map:Map, initparams:Object) {
2525
super();
2626
this.init(token, w, h);
2727
this.mapType="satellite";
28-
this.alpha=0.5;
2928
this.map=map;
3029
inited=false;
3130
visible=enabled=false;
31+
if (initparams['background_dim'] == null || initparams['background_dim']) alpha = 0.5;
32+
else alpha=1; // map.getDimming() not initialised yet.
33+
3234
this.addEventListener(YahooMapEvent.MAP_INITIALIZE, initHandler);
3335
}
3436

potlatch2.mxml

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
theMap.addEventListener(MapEvent.INITIALISED, function(e:Event):void { VectorBackgrounds.instance().init(theMap); });
174174
175175
theMap.backdrop=b;
176-
yahoo=new Yahoo(w,h,theMap);
176+
yahoo=new Yahoo(w,h,theMap, params);
177177
yahoo.hide();
178178
_root.addChild(yahoo);
179179
_root.addChild(theMap);

0 commit comments

Comments
 (0)