]> git.openstreetmap.org Git - potlatch2.git/commitdiff
Don't die if the tileserver isn't responding.
authorRichard Fairhurst <richard@systemeD.net>
Sat, 11 Feb 2012 15:39:15 +0000 (15:39 +0000)
committerRichard Fairhurst <richard@systemeD.net>
Sat, 11 Feb 2012 15:39:15 +0000 (15:39 +0000)
(Was really starting to hack me off...)

net/systemeD/halcyon/TileSet.as

index 5d2e1eacdcf11ea4222a5bd9ab90ed5a53613156..84d6576f9c8c9ec410ab8dbeff0dceac800529b5 100644 (file)
@@ -50,6 +50,11 @@ package net.systemeD.halcyon {
                public function init(params:Object, update:Boolean=false):void {
                        baseurl=params.url;
                        scheme =params.scheme ? params.scheme : '900913';
+                       requests=[]; waiting=loadcount=0;
+                       for (var tilename:String in tiles) {
+                               if (tiles[tilename] is Loader) tiles[tilename].unload();
+                               tiles[tilename]=null;
+                       }
                        tiles={};
                        offset_lon=offset_lat=x=y=0;
                        while (numChildren) { removeChildAt(0); }
@@ -133,8 +138,8 @@ package net.systemeD.halcyon {
                                        waiting++;
                                        var loader:Loader = new Loader();
                                        tiles[map.scale+','+tx+','+ty]=loader;
-                                       loader.contentLoaderInfo.addEventListener(Event.INIT, doImgInit);
-                       loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, missingTileError);
+                                       loader.contentLoaderInfo.addEventListener(Event.INIT, doImgInit, false, 0, true);
+                                       loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, missingTileError, false, 0, true);
                                        loader.load(new URLRequest(tileURL(tx,ty,tz)), 
                                                    new LoaderContext(true));
                                        l=this.getChildAt(map.scale-map.MINSCALE);