Class: Feature

ol. Feature

Extend ol/Feature


new Feature()

Source:
ol/ol.jsdoc

Methods


getIgnStyle( [property] [, iStyle])

Get IGN style for a feature

Parameters:
Name Type Argument Description
property string | boolean | undefined <optional>
  • if string will return the named property
  • if true will return all properties
  • if undefined will return all properties on the feature
iStyle Object <optional>

prevalent style

Source:
ol/Feature.js
Returns:

the style

Type
string | number | Array

getInfoContent()

Get info content (1 line abstract)

Source:
ol/Feature.js
Returns:
Type
string

getLabelContent(options)

Get labelcontent for a feature

Parameters:
Name Type Description
options Object | true | undefined

popup options (with a content propertie) or undefined to get the popupcontent object

Source:
ol/Feature.js
Returns:

labelcontent

Type
html

getLayer()

Get layer for a feature

Source:
ol/Feature.js
Returns:

the layer

Type
ol.layer.Layer | undefined

getPopupContent(options [, html])

Get popupcontent for a feature

Parameters:
Name Type Argument Default Description
options Object | true | undefined

popup options (with a content propertie) or undefined to get the popupcontent object

Properties
Name Type Description
titre string
desc string

description as Markdown

img string

image url

coord boolean
html boolean <optional>
false

true return html string

Source:
ol/Feature.js
Returns:

popupcontent

Type
string | Element

hasPopupContent()

Check if a feature has a popupcontent

Source:
ol/Feature.js
Returns:
Type
boolean

setIgnStyle(property, val)

Set IGN style for a feature

Parameters:
Name Type Description
property string | Object

the property to set or a full ignStyle

val string | number

the value to set

Source:
ol/Feature.js

setLayer(layer)

Set layer for a feature

Parameters:
Name Type Description
layer ol.layer.Layer
Source:
ol/Feature.js

setPopupContent(options)

Set popupcontent for a feature

Parameters:
Name Type Description
options
Properties
Name Type Description
active boolean
titre string
desc string

description as Markdown

img string

image url

img string
coord boolean
Source:
ol/Feature.js

showPopup(popup, coord [, geom])

Show a popup at the right place If the feature has no content the popup is hidden. The popup is placed on the object (closest point) and use the feature style to calculate the offset from the point symbol.

Parameters:
Name Type Argument Description
popup ol.Overlay.Popup

the popup to display on the map

coord ol.Coordinate

popup position (the closest point will be used)

geom ol.geom | undefined <optional>

use as geometry, default use object geom

Source:
ol/Feature.js
Returns:

the popup content

Type
string