new Feature()
- Source:
- ol/ol.jsdoc
Methods
-
getIgnStyle( [property] [, iStyle])
-
Get IGN style for a feature
Parameters:
Name Type Argument Description propertystring | 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
iStyleObject <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 optionsObject | 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 optionsObject | true | undefined popup options (with a content propertie) or undefined to get the popupcontent object
Properties
Name Type Description titrestring descstring description as Markdown
imgstring image url
coordboolean htmlboolean <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 propertystring | Object the property to set or a full ignStyle
valstring | number the value to set
- Source:
- ol/Feature.js
-
setLayer(layer)
-
Set layer for a feature
Parameters:
Name Type Description layerol.layer.Layer - Source:
- ol/Feature.js
-
setPopupContent(options)
-
Set popupcontent for a feature
Parameters:
Name Type Description optionsProperties
Name Type Description activeboolean titrestring descstring description as Markdown
imgstring image url
imgstring coordboolean - 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 popupol.Overlay.Popup the popup to display on the map
coordol.Coordinate popup position (the closest point will be used)
geomol.geom | undefined <optional>
use as geometry, default use object geom
- Source:
- ol/Feature.js
Returns:
the popup content
- Type
- string