Mark snapshot layers as interactive
[potlatch2.git] / net / systemeD / potlatch2 / utils / SnapshotLoader.as
1 package net.systemeD.potlatch2.utils {
2
3     import net.systemeD.halcyon.Map;
4     import net.systemeD.halcyon.MapPaint;
5     import net.systemeD.potlatch2.utils.SnapshotConnection;
6
7     public class SnapshotLoader {
8
9         private var map:Map;
10         private var _layer:MapPaint;
11         private static const STYLESHEET:String="stylesheets/snapshot.css"; //TODO take from xml
12         private var connection:SnapshotConnection;
13
14
15         public function SnapshotLoader(map:Map, url:String, name:String):void {
16             this.map = map;
17             connection = new SnapshotConnection(name, url, '');
18         }
19
20         public function load():void {
21             if (!_layer) {
22                 _layer = map.addLayer(connection, STYLESHEET, true, true);
23             }
24             connection.loadBbox(map.edge_l, map.edge_r, map.edge_t, map.edge_b);
25         }
26     }
27 }