Feature Anchor ARAnchor ScreenAnchor Geometry GMLGeometry Point

Copyright © 2015 Open Geospatial Consortium 73

8.3 Object and Constructor Definitions

The ECMAScript bindings of the objects specified in ARML follow some simple principles. 1. Only concrete classes of ARML can be constructed in a valid way. 2. Constructor parameters consist of all mandatory attributes of the class, plus an optional dictionary keyvalue JSON object parameter allowing the population of all optional parameters. 3. Read‐only parameters can only be populated at construction time of the object and must not be altered later. Any misuse of constructors, methods or properties e.g. wrong number of parameters or illegal values provided must result in an Exception. Requirement http:www.opengis.netspecarml2.0reqscriptinggeneralmisuse Any misuse of constructors, methods and properties shall result in an Exception Remark: All objects defined below are accessible through the arml namespace and, in WebIDL terms, belong to the arml module. For example, a new Feature can be created with new arml.Feature; interface ARElement { readonly attribute string id; }; dictionary ARElementDict { string id; };

8.3.1 Feature

[Constructoroptional FeatureDict initDict] interface Feature : ARElement { attribute string name; attribute string description; attribute boolean enabled; attribute object metadata; attribute Anchor[] anchors; }; dictionary FeatureDict : ARElementDict { string name; string description; boolean enabled; object metadata; Anchor[] anchors; };

8.3.2 Anchor

interface Anchor : ARElement { attribute boolean enabled; }; Copyright © 2015 Open Geospatial Consortium 74 dictionary AnchorDict : ARElementDict { boolean enabled; };

8.3.3 ARAnchor

interface ARAnchor : Anchor { attribute VisualAsset[] assets; void addEventListenerstring type, EventListener listener; void removeEventListenerstring type, EventListener listener; }; dictionary ARAnchorDict : AnchorDict { VisualAsset[] assets; };

8.3.4 ScreenAnchor

[ConstructorLabel[] assets, optional ScreenAnchorDict initDict] interface ScreenAnchor : Anchor { attribute string class; attribute ScreenAnchorStyleDict style; attribute Label[] assets; }; dictionary ScreenAnchorDict : AnchorDict { string class; ScreenAnchorStyleDict style; }; dictionary ScreenAnchorStyleDict { string top; string bottom; string left; string right; string width; string height; };

8.3.5 Geometry

interface Geometry : ARAnchor { readonly attribute GMLGeometry gmlGeometry; }; dictionary GeometryDict : ARAnchorDict { GMLGeometry gmlGeometry; };

8.3.6 GMLGeometry

interface GMLGeometry { readonly attribute string id; }; Copyright © 2015 Open Geospatial Consortium 75

8.3.7 Point

[Constructorstring id, double[] pos, optional PointDict initDict] interface Point : GMLGeometry { attribute double[] pos; readonly attribute string srsName; readonly attribute string srsDimension; }; dictionary PointDict { string srsName; string srsDimension; };

8.3.8 LineString