add browser help links for map features
authorDave Stubbs <osm@randomjunk.co.uk>
Sat, 9 Jan 2010 17:17:16 +0000 (17:17 +0000)
committerDave Stubbs <osm@randomjunk.co.uk>
Sat, 9 Jan 2010 17:17:16 +0000 (17:17 +0000)
net/systemeD/potlatch2/TagViewer.mxml
net/systemeD/potlatch2/mapfeatures/Feature.as
resources/map_features.xml

index 5fc43f4..d47478c 100644 (file)
@@ -68,6 +68,7 @@
       import mx.core.*;
       import mx.managers.PopUpManager;
       import flash.geom.Point;
+      import flash.net.*;
       
       private var mapFeatures:MapFeatures;
       private var selectedEntity:Entity;
           popupChange.label = feature.name;
           setLimitTypes(entity);
           tw.setSelectedFeature(feature);
+          helpLabel.visible = feature.hasHelpURL();
       }
       
       private function setLimitTypes(entity:Entity):void {
           popupChange.label = "unknown";
           setLimitTypes(entity);
           tw.setSelectedFeature(null);
+          helpLabel.visible = false;
       }
 
       private function initialiseEditors():void {
 
       public function openDescription():void {
           trace("open description here");
+          if ( feature != null && feature.hasHelpURL() )
+              navigateToURL(new URLRequest(feature.helpURL), "potlatch_help");
       }
 
       public function addNewTag():void {
index 39b46d0..7036c0f 100644 (file)
@@ -142,6 +142,13 @@ package net.systemeD.potlatch2.mapfeatures {
             return _xml.elements(type).length() > 0;
         }
         
+        public function hasHelpURL():Boolean {
+            return _xml.help.length() > 0;
+        }
+        
+        public function get helpURL():String {
+            return _xml.help;
+        }
     }
 }
 
index 9730746..cd92e3b 100644 (file)
     <icon image="features/highway__motorway.png">
       <font size="16pt"><b>${ref}</b></font><br/>
     </icon>
+    <help>http://wiki.openstreetmap.org/wiki/Tag:highway%3Dmotorway</help>
 
     <line/>
     <tag k="highway" v="motorway"/>
       <font size="16pt"><b>${ref}</b></font><br/>
       <font size="10pt">${name}</font>
     </icon>
+    <help>http://wiki.openstreetmap.org/wiki/Tag:highway%3Dtrunk</help>
 
     <line/>
     <tag k="highway" v="trunk"/>
       <font size="16pt"><b>${ref}</b></font><br/>
       <font size="10pt">${name}</font>
     </icon>
+    <help>http://wiki.openstreetmap.org/wiki/Tag:highway%3Dprimary</help>
 
     <line/>
     <tag k="highway" v="primary"/>
       <font size="16pt"><b>${ref}</b></font><br/>
       <font size="10pt">${name}</font>
     </icon>
+    <help>http://wiki.openstreetmap.org/wiki/Tag:highway%3Dsecondary</help>
 
     <line/>
     <tag k="highway" v="secondary"/>
       <font size="14pt"><b>${name}</b></font><br/>
       <font size="10pt">${ref}</font>
     </icon>
+    <help>http://wiki.openstreetmap.org/wiki/Tag:highway%3Dtertiary</help>
 
     <line/>
     <tag k="highway" v="tertiary"/>
       <font size="14pt"><b>${name}</b></font><br/>
       <font size="8pt">${postal_code}</font><br/>
     </icon>
+    <help>http://wiki.openstreetmap.org/wiki/Tag:highway%3Dresidential</help>
 
     <line/>
     <tag k="highway" v="residential"/>
     <icon image="features/highway__unclassified.png">
       <font size="14pt"><b>${name}</b></font>
     </icon>
+    <help>http://wiki.openstreetmap.org/wiki/Tag:highway%3Dunclassified</help>
 
     <line/>
     <tag k="highway" v="unclassified"/>
     <icon image="features/highway__service.png">
       <font size="14pt"><b>${name}</b></font>
     </icon>
+    <help>http://wiki.openstreetmap.org/wiki/Tag:highway%3Dservice</help>
     <description>
       Access roads
     </description>