and this might help
authorRichard Fairhurst <richard@systemed.net>
Fri, 4 Sep 2009 17:28:12 +0000 (17:28 +0000)
committerRichard Fairhurst <richard@systemed.net>
Fri, 4 Sep 2009 17:28:12 +0000 (17:28 +0000)
net/systemeD/halcyon/WayBitmapFiller.as [new file with mode: 0644]

diff --git a/net/systemeD/halcyon/WayBitmapFiller.as b/net/systemeD/halcyon/WayBitmapFiller.as
new file mode 100644 (file)
index 0000000..c1a7845
--- /dev/null
@@ -0,0 +1,33 @@
+package net.systemeD.halcyon {
+
+       import net.systemeD.halcyon.styleparser.*;
+    import net.systemeD.halcyon.connection.*;
+       import flash.display.*;
+       import flash.events.*;
+
+       public class WayBitmapFiller {
+               private var wayui:WayUI;
+               private var style:ShapeStyle;
+               private var graphics:Graphics;
+               private var loader:Loader = new Loader();
+
+               public function WayBitmapFiller(wayui:WayUI,graphics:Graphics,style:ShapeStyle) {
+                       this.wayui=wayui;
+                       this.graphics=graphics;
+                       this.style=style;
+                       
+                       if (wayui.map.ruleset.images[style.fill_image]) {
+                               loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadedFill);
+                               loader.loadBytes(wayui.map.ruleset.images[style.fill_image]);
+                       }
+               }
+               
+               private function loadedFill(event:Event):void {
+                       var image:BitmapData = new BitmapData(loader.width, loader.height, false);
+                       image.draw(loader);
+                       graphics.beginBitmapFill(image);
+                       wayui.solidLine(graphics);
+                       graphics.endFill();
+               }
+       }
+}
\ No newline at end of file