Remove VectorLayer from EditController and fix up references in various sidebar panels
[potlatch2.git] / net / systemeD / potlatch2 / panels / MarkerPanel.mxml
1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4     Marker Panel
5 -->
6
7 <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" height="100%">
8   <mx:Text id="markerPanelText" text="You have selected a marker." width="100%" styleName="helpInfo" />
9   <mx:DataGrid editable="false" id="markerPanelDG" width="100%" height="50%">
10     <mx:columns>
11       <mx:DataGridColumn editable="false" dataField="key" headerText="key" />
12       <mx:DataGridColumn editable="false" dataField="value" headerText="value" />
13     </mx:columns>
14   </mx:DataGrid>
15   <mx:Script><![CDATA[
16
17       import net.systemeD.halcyon.connection.*;
18       import net.systemeD.halcyon.MapPaint;
19       import mx.collections.*;
20
21       private var selectedEntity:Entity;
22       private var tagDataProvider:ArrayCollection;
23       private var layer:MapPaint;
24
25       public function init(entity:Entity, layer:MapPaint):void {
26             this.layer = layer;
27             if ( tagDataProvider == null ) {
28                 tagDataProvider = new ArrayCollection();
29                 markerPanelDG.dataProvider = tagDataProvider;
30             }
31
32             selectedEntity=entity;
33             updateTagDataProvider();
34       }
35
36       private function updateTagDataProvider():void {
37             tagDataProvider.removeAll();
38             if (selectedEntity==null) { return; }
39             var tags:Array = selectedEntity.getTagArray();
40             tags.sortOn("key");
41             for each(var tag:Tag in tags) { tagDataProvider.addItem(tag); }
42       }
43       ]]>
44   </mx:Script>
45 </mx:VBox>