Class: Area

.xyz.maps.editor.features. Area

new Area(id, coordinates, properties)

Parameters:
Name Type Argument Description
id String | Number <optional>
of the Area
coordinates Array.<here.xyz.maps.editor.GeoCoordinate> | Array.<here.xyz.maps.editor.PixelCoordinate> Coordinates of the feature
properties here.xyz.maps.editor.features.Feature.Properties <optional>
Properties of the area feature.

Extends

Classes

Shape

Members Summary

bbox :Array.<number>

Bounding box of the feature.
The value of the bbox member is an array of length 4, with all axes of the most southwesterly point followed by all axes of the more northeasterly point.
The "bbox" values define shapes with edges that follow lines of constant longitude and latitude.

class :string

Feature class of this feature, the value is "AREA".

geometry :object

A geometry is a object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon" or "MultiPolygon".
A geometry object must have a member with the name "coordinates".
The value of the coordinates member is always an array (referred to as the coordinates array below).
The structure for the elements in this array are determined by the type of geometry.

For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension.
There must be at least two elements, and may be more.
The order of elements must follow x, y, z order (or longitude, latitude, altitude for coordinates in a geographic coordinate reference system).

For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".

For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point".
The coordinates array for a LineString must have two or more elements.
A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points).
Though a LinearRing is not explicitly represented as a geometry type, it is referred to in the Polygon geometry type definition.

For type "MultiLineString", each element in the coordinates array is a coordinates array as described for type "LineString".

For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString".
Furthermore, each LineString in the coordinates array must be a LinearRing.
For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.

For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type "Polygon".

id :number

id of the feature.

properties :here.xyz.maps.editor.features.Feature.Properties

properties of this feature.

Methods Summary

addShape(point, polygon, index) → {boolean|number}

Add a new shape point to the area.

coord() → {Array.<Array>}

Get coordinates of the feature.

coord(coords)

Set coordinates of the feature.

editable(editable)

Set the object editable or read only.

prop() → {here.xyz.maps.editor.features.Area.Properties}

Get deep copy of all properties of the feature

prop(property) → {number|string|Array.<string>|object}

Get the value of an specific property

prop(property, value)

Set the value for an specific property

prop(properties)

Set one or more properties of the object.

remove()

Remove the object.

select()

Highlight and selects this object.

style(style) → {Array.<here.xyz.maps.layers.TileLayer.Style>}

Get default or current style of the feature.

style(style)

Apply style to the feature.

transform()

Helper function to transform the object (move/scale/rotate)

unselect()

Unselect the object, unhightlight it.

Members Details

bbox :Array.<number> [Optional]

Bounding box of the feature.
The value of the bbox member is an array of length 4, with all axes of the most southwesterly point followed by all axes of the more northeasterly point.
The "bbox" values define shapes with edges that follow lines of constant longitude and latitude.
Type:
Array.<number>
Inherited From:

class :string

Feature class of this feature, the value is "AREA".
Type:
string

geometry :object

A geometry is a object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon" or "MultiPolygon".
A geometry object must have a member with the name "coordinates".
The value of the coordinates member is always an array (referred to as the coordinates array below).
The structure for the elements in this array are determined by the type of geometry.

For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension.
There must be at least two elements, and may be more.
The order of elements must follow x, y, z order (or longitude, latitude, altitude for coordinates in a geographic coordinate reference system).

For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point".

For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point".
The coordinates array for a LineString must have two or more elements.
A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points).
Though a LinearRing is not explicitly represented as a geometry type, it is referred to in the Polygon geometry type definition.

For type "MultiLineString", each element in the coordinates array is a coordinates array as described for type "LineString".

For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString".
Furthermore, each LineString in the coordinates array must be a LinearRing.
For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes.

For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type "Polygon".
Type:
object
Inherited From:
Example:
Point:
{
   "type": "Point",
   "coordinates": [100.0, 0.0]
}

Polygon:
{
    "type": "Polygon",
    "coordinates": [
        [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]
    ]
}

id :number

id of the feature.
Type:
number
Inherited From:

properties :here.xyz.maps.editor.features.Feature.Properties

properties of this feature.
Type:
here.xyz.maps.editor.features.Feature.Properties
Inherited From:

Methods Details

addShape(point, polygon, index) → {boolean|number}

Add a new shape point to the area.
Parameters:
Name Type Argument Description
point here.xyz.maps.editor.PixelCoordinate the coordinate of the new shape.
polygon Number <optional>
index the index of the polygon to add the shape.
index Number <optional>
the index of the polygon shapes to insert.
Returns:
shape index of polygon or false if could not be added
Type:
boolean | number

coord() → {Array.<Array>}

Get coordinates of the feature.
Returns:
coordinates of the feature:[ [ [ [longitude, latitude, z], [longitude, latitude, z], , , , ] ] ].
Type:
Array.<Array>

coord(coords)

Set coordinates of the feature.
Parameters:
Name Type Description
coords Array.<Array> coordinates of the feature:[ [ [ [longitude, latitude, z], [longitude, latitude, z], , , , ] ] ].

editable(editable)

Set the object editable or read only.
Parameters:
Name Type Description
editable Boolean True, the object is editable. false, the object is read only.
Inherited From:
Example:
object.editable(false); // set the object read only

 

prop() → {here.xyz.maps.editor.features.Area.Properties}

Get deep copy of all properties of the feature
Returns:
return properties of the object
Type:
here.xyz.maps.editor.features.Area.Properties

prop(property) → {number|string|Array.<string>|object}

Get the value of an specific property
Parameters:
Name Type Description
property string property name
Returns:
value of the specific property
Type:
number | string | Array.<string> | object

prop(property, value)

Set the value for an specific property
Parameters:
Name Type Description
property string property name
value number | string | Array.<string> | object value of the specific property

prop(properties)

Set one or more properties of the object.
Parameters:
Name Type Description
properties here.xyz.maps.editor.features.Area.Properties properties of the feature

remove()

Remove the object.
Inherited From:

select()

Highlight and selects this object.
Inherited From:

style(style) → {Array.<here.xyz.maps.layers.TileLayer.Style>}

Get default or current style of the feature.
Parameters:
Name Type Argument Default Description
style string <optional>
"default" a string indicating which style to return, either "default" or "current".
Returns:
styles style of this feature
Type:
Array.<here.xyz.maps.layers.TileLayer.Style>

style(style)

Apply style to the feature.
Parameters:
Name Type Description
style Array.<here.xyz.maps.layers.TileLayer.Style> the style to set for the feature

transform()

Helper function to transform the object (move/scale/rotate)
Inherited From:

unselect()

Unselect the object, unhightlight it.
Inherited From: