Packagenet.systemeD.potlatch2.mapfeatures
Classpublic class Feature
InheritanceFeature Inheritance flash.events.EventDispatcher

A "map feature" is sort of a template for a map entity. It consists of a few crucial key/value pairs that define the feature, so that entities can be recognised. It also contains optional keys, with associated editing controls, that are defined as being appropriate for the feature.



Public Properties
 PropertyDefined by
  definition : XML
[read-only] The XML subtree that this feature was loaded from.
Feature
  description : String
[read-only] The human-readable description of the feature, or null if none.
Feature
  dndimage : ByteArray
[read-only] Returns the drag+drop override-icon defined for the feature.
Feature
  editors : Array
[read-only] List of editing controls associated with this feature.
Feature
  helpURL : String
[read-only] The defined help string, if any.
Feature
  image : ByteArray
[read-only] Returns the icon defined for the feature.
Feature
  missingIconCls : Class
Feature
  name : String
[read-only] The human-readable name of the feature (
Feature
  tags : Array
[read-only] List of {k, v} pairs that define the feature.
Feature
  withins : Array
[read-only] List of "withins" which further restrict the applicability of the feature.
Feature
Public Methods
 MethodDefined by
  
Feature(mapFeatures:MapFeatures, _xml:XML)
Create this Feature from an XML subtree.
Feature
  
canDND():Boolean
Can this feature be drag-and-dropped from the side panel? By default, any "point" feature can, unless it has
Feature
  
The first category that the feature belongs to, as defined by the order of the map features XML file.
Feature
  
hasHelpURL():Boolean
Whether there is a help string defined or one can be derived from tags.
Feature
  
htmlDetails(entity:Entity):String
Feature
  
htmlEscape(str:String):String
[static] Basic HTML escaping.
Feature
  
isInCategory(category:String):Boolean
Whether this feature belongs to the given category or not, as defined by its definition in the XML file.
Feature
  
isType(type:String):Boolean
Whether the feature is of the given type (point, line/area, relation).
Feature
  
makeHTMLIcon(icon:XMLList, entity:Entity):String
[static] Convert the contents of the "icon" tag as an HTML string, with variable substitution.
Feature
Property detail
definitionproperty
definition:XML  [read-only]

The XML subtree that this feature was loaded from.

Implementation
    public function get definition():XML
descriptionproperty 
description:String  [read-only]

The human-readable description of the feature, or null if none.

This property can be used as the source for data binding.

Implementation
    public function get description():String
dndimageproperty 
dndimage:ByteArray  [read-only]

Returns the drag+drop override-icon defined for the feature. This uses the "dnd" property of the feature's icon element, or if there is no override-icon it falls back to the standard image.

This property can be used as the source for data binding.

Implementation
    public function get dndimage():ByteArray
editorsproperty 
editors:Array  [read-only]

List of editing controls associated with this feature.

Implementation
    public function get editors():Array
helpURLproperty 
helpURL:String  [read-only]

The defined help string, if any. If none, generate one from tags on the feature, pointing to the OSM wiki.

Implementation
    public function get helpURL():String
imageproperty 
image:ByteArray  [read-only]

Returns the icon defined for the feature. This uses the "image" property of the feature's icon element. If no image property is defined, returns a default "missing icon".

This property can be used as the source for data binding.

Implementation
    public function get image():ByteArray
missingIconClsproperty 
public var missingIconCls:Class

This property can be used as the source for data binding.

nameproperty 
name:String  [read-only]

The human-readable name of the feature (

This property can be used as the source for data binding.

Implementation
    public function get name():String
tagsproperty 
tags:Array  [read-only]

List of {k, v} pairs that define the feature.

Implementation
    public function get tags():Array
withinsproperty 
withins:Array  [read-only]

List of "withins" which further restrict the applicability of the feature. Each within is a {entity, k, ?v, ?minimum, ?role} object.

Implementation
    public function get withins():Array
Constructor detail
Feature()constructor
public function Feature(mapFeatures:MapFeatures, _xml:XML)

Create this Feature from an XML subtree.

Parameters
mapFeatures:MapFeatures
 
_xml:XML
Method detail
canDND()method
public function canDND():Boolean

Can this feature be drag-and-dropped from the side panel? By default, any "point" feature can, unless it has

Returns
Boolean
findFirstCategory()method 
public function findFirstCategory():Category

The first category that the feature belongs to, as defined by the order of the map features XML file.

Returns
Category
hasHelpURL()method 
public function hasHelpURL():Boolean

Whether there is a help string defined or one can be derived from tags.

Returns
Boolean
htmlDetails()method 
public function htmlDetails(entity:Entity):StringParameters
entity:Entity

Returns
String
htmlEscape()method 
public static function htmlEscape(str:String):String

Basic HTML escaping.

Parameters
str:String

Returns
String
isInCategory()method 
public function isInCategory(category:String):Boolean

Whether this feature belongs to the given category or not, as defined by its definition in the XML file.

Parameters
category:String

Returns
Boolean
isType()method 
public function isType(type:String):Boolean

Whether the feature is of the given type (point, line/area, relation).

Parameters
type:String

Returns
Boolean
makeHTMLIcon()method 
public static function makeHTMLIcon(icon:XMLList, entity:Entity):String

Convert the contents of the "icon" tag as an HTML string, with variable substitution.

Parameters
icon:XMLList
 
entity:Entity

Returns
String