Class: Feature

cercalia.Feature

new cercalia.Feature(options)

Name Type Description
options

Feature options

Name Type Description
draggable boolean | undefined optional

Boolean indicating if dragging is being enabled or not.

editable boolean | undefined optional

Boolean indicating if editing is being enabled or not.

fillColor number | undefined optional

Feature fill color. Default value #009BFF.

fillOpacity number | undefined optional

Feature fill opacity. Default value 0.9.

geometry ol.Geometry | undefined optional

OpenLayers3 geometry ol.Geometry that indicates the feature to be painted.

id string | undefined optional

Marker ID. If not specified, it's automatically generated.

iconArrow string | undefined optional

Icon URL. If not specified, API uses the default cercalia icon. If uses a custom icon, the arrow should be pointing upwards

lineDash Array.<number> | undefined optional

Line dash. Array of two values, continuous-discontinuous. For example [40, 20], [10, 10], [10, 20, 40, 60].

onClick function | undefined optional

Function to execute on feature click.

onDoubleClick function | undefined optional

Function to execute on feature double click.

onDragEnd function | undefined optional

Function to execute when ends feature dragging.

onDragMove function | undefined optional

Function to execute during feature dragging.

onDragStart function | undefined optional

Function to execute on feature dragging start.

onDrop function | undefined optional

Function to execute on feature drop. Returns the position of dragged features list

onMouseOut function | undefined optional

Function to execute on Mouse Out.

onMouseOver function | undefined optional

Function to execute on Mouse Over.

onRightClick function | undefined optional

Function to execute on feature right click.

outline boolean | undefined optional

Enable outline feature property. If no outline required, specify null. Default value true.

outlineColor number | undefined optional

Feature outline color. Default value #00ff00

outlineOpacity number | undefined optional

Feature outline opacity. Default value 1.

outlineWidth number | undefined optional

Feature outline width. Default value 7.

pointEditableColor string | undefined optional

Vertices color. Only enabled in editing mode.

radius number | undefined optional

Point radius.

simpleLabel cercalia.SimpleLabel | null

SimpleLabel feature.

showDirection string | undefined optional

Show direction (arrows)

srs string | undefined optional

Projection. Default value: ESPG:4326.

strokeOpacity number | undefined optional

Feature stroke opacity. Default value 0.7.

strokeColor number | undefined optional

Feature stroke color. Default value #ffffff.

strokeWidth number | undefined optional

Feature stroke width. Default value 5.

wkt string | undefined optional

WKT String with shape geometry to be painted.

zIndex number | undefined optional

zIndex.

Members

onClick{function}

onDoubleClick{function}

onDrop{funtion}

onMouseOut{function}

onMouseOver Function, if specified

onMouseOver{function}

onRightClick{function}

Methods

Name Type Description
onClick function | undefined optional
Name Type Description
onDragEnd function | undefined optional
Name Type Description
onDragMove function | undefined optional

addOnDragStart(onDragStart)

Name Type Description
onDragStart function | undefined optional

Destroy object and related atributes to free up memory

Returns:
Returns the feature limits

Returns the object type.

Name Type Description
position cercalia.LonLat

Position

Returns:
Closest position of feature respect parameter position.
Returns:
Object ol.Feature Openlayers3
Returns:
Fill color
Returns:
Fill opacity. Values between 0 and 1.
Returns:
Internal feature ID

getLineDash(){Array.<number>}

Returns:
Line dash.
Returns:
Map object cercalia.Map
Returns:
Outline color.

getOutlineOpacity(){number}

Returns:
Feature object outline opacity.
Returns:
Outline width
Returns:
circle Radius (in pixels).
Returns:
Returns cercalia.SimpleLabel if it's created. If not, returns null.
Returns:
Outline color.
Returns:
Feature opacity. Values: [0..1].
Returns:
Outline width
Returns:
Feature WKT (Well-known-text). WKT has not Circle type format.
Returns:
zIndex Feature object

Returns true if the feature has directions created and visibles.

Hide arrow directions of feature.

Returns:
Returns the drag status for feature. Values: true or false.

True if feature is dragging, otherwise false.

Returns:
Returns the edit status for feature. Values: true or false.

Converts the feature object to draggable. You can drag the feature.

Name Type Description
draggable boolean

Modify the edit status for feature. Values: true or false.

setEditablePointColor(){string}

Returns:
Change vertices color when is in editing mode.

Assign the fillcolor.

Name Type Description
Fill string

color Hexadecimal color. Ex: '#ff0000'

setFillOpacity(fillOpacity)

Assign Fill opacity. Values between 0 and 1.

Name Type Description
fillOpacity number

Fill opacity. Values between 0 and 1.

Assign an ID to the feature.

Name Type Description
id string

Assign Line dash.

Name Type Description
lineDash Array.<number>

Line dash.

Add or remove map reference. For add a feature, use the class cercalia.Map function addFeature or addFeatures

Name Type Description
map cercalia.Map

Cercalia Map.

setOutlineColor(outlineColor)

Asign the outline color.

Name Type Description
outlineColor string

object color

setOutlineOpacity(outlineOpacity)

Assigns the object outline opacity. Feature.

Name Type Description
outlineOpacity number

feature outline opacity.

setOutlineWidth(outlineWidth)

Name Type Description
outlineWidth number

outiline width

Assigns the feature object outline opacity.

Name Type Description
radius number

setSimpleLabel(simpleLabel)

SimpleLabel to add/modify related to the marker

Name Type Description
simpleLabel cercalia.SimpleLabel

setStrokeColor(strokeColor)

Assign the object outiline color.

Name Type Description
strokeColor string

Object Color

setStrokeOpacity(strokeOpacity)

Assigns the feature object outline opacity. Feature.

Name Type Description
strokeOpacity number

Opacity, values between 0 y 1. -> [0..1]

setStrokeWidth(strokeWidth)

Name Type Description
strokeWidth number

Outline width

Assigns a zIndex to Feature object

Name Type Description
zIndex number

zIndex CSS.

Show arrow directions of feature