beginning of vector background layers. And a whole load of other stuff too
[potlatch2.git] / net / systemeD / halcyon / vectorlayers / VectorLayer.as
1 package net.systemeD.halcyon.vectorlayers {
2
3         import net.systemeD.halcyon.Map;
4         import net.systemeD.halcyon.MapPaint;
5         import net.systemeD.halcyon.connection.Node;
6         import net.systemeD.halcyon.connection.Way;
7         import net.systemeD.halcyon.connection.Relation;
8
9         public class VectorLayer extends Object {
10
11                 public var map:Map;
12                 public var paint:MapPaint;                                              // sprites
13
14                 public var ways:Object=new Object();                    // geodata
15                 public var nodes:Object=new Object();                   //  |
16                 public var relations:Object=new Object();               //  |
17         private var negativeID:Number = -1;
18
19                 public function VectorLayer(m:Map) {
20                         map=m;
21                         paint=new MapPaint(m,0,0);
22                 }
23                 
24                 public function createNode(tags:Object,lat:Number,lon:Number):Node {
25                         var node:Node = new Node(negativeID, 0, tags, true, lat, lon);
26                         nodes[negativeID]=node; negativeID--;
27                         return node;
28                 }
29                 public function createWay(tags:Object,nodes:Array):Way {
30                         var way:Way = new Way(negativeID, 0, tags, true, nodes.concat());
31                         ways[negativeID]=way; negativeID--;
32                         return way;
33                 }
34                 public function createRelation(tags:Object,members:Array):Relation {
35             var relation:Relation = new Relation(negativeID, 0, tags, true, members.concat());
36                         relations[negativeID]=relation; negativeID--;
37             return relation;
38                 }
39
40         }
41 }