Class: VectorStyle

ol.layer. VectorStyle


new VectorStyle( [options])

Layer with a style function based on IGN style. Features in the layer are linked to the layer (f.getLayer() to get the layer it belongs to).

Parameters:
Name Type Argument Description
options olx.layer.VectorOptions <optional>

Options, extend olx.layer.VectorOptions.

Properties
Name Type Description
ghostStyle boolean

true to show a ghost feature when size=0

Source:
layer/VectorStyle.js

Extends

  • ol.layer.Vector

Members


defaultIgnStyle

Default IGN style

Source:
layer/VectorStyle.js

Methods


activateCluster(b, silent)

Activate cluster calculation. Deactivate calculation before doing large operation on source

Parameters:
Name Type Description
b boolean
silent boolean
Source:
layer/VectorStyle.js

addFilter(filter)

Add a filter to a VectorLayer

Parameters:
Name Type Description
filter ol/filter
Source:
layer/VectorStyle.js

clearCache()

Clear cache

Source:
layer/VectorStyle.js

getAttributes()

Get layer attributes list

Source:
layer/VectorStyle.js
Returns:
Type
Objet

getConditionStyle()

Get conditions to style the layer

Source:
layer/VectorStyle.js
Returns:
Type
Array.<conditionStyle>

getGeomTypes(type)

Get geometry type of a layer or test if it has type as geometry

Parameters:
Name Type Description
type ol.geom.GeometryType | undefined

the type of geom to look for or default to get an array of types, default undefined

Source:
layer/VectorStyle.js
Returns:

if type is specified checks if all features are of this type, otherwise returns an array of type

Type
boolean | Object

getIgnStyle( [f], res, ignStyle)

Get ignStyle for the layer or a feature

Parameters:
Name Type Argument Default Description
f ol.Feature | boolean <optional>
false

the feature or true to get full ignStyle, undefined to get the layer's default style

res number

current resolution

ignStyle Object
Source:
layer/VectorStyle.js

getLayer()

Get the current layer displayed on the map

Source:
layer/VectorStyle.js
Returns:

render mode

Type
vector | image | cluster

getMode()

Get render mode

Source:
layer/VectorStyle.js
Returns:

render mode

Type
vector | image | cluster

getPopupContent(f)

Get popupcontent for a feature

Parameters:
Name Type Description
f ol.Feature | undefined

the feature to get information on, if undefined get the popupcontent of the layer

Source:
layer/VectorStyle.js
Returns:

popupcontent

Type
html

getSource()

Get Layer source

Source:
layer/VectorStyle.js

getStyle()

Get layer style

Source:
layer/VectorStyle.js

removeFilter(filter)

Remove a filter to a VectorLayer

Parameters:
Name Type Description
filter ol/filter
Source:
layer/VectorStyle.js

selectable( [selectable])

Check if layer is selectable

Parameters:
Name Type Argument Description
selectable boolean <optional>

if define set selectable, default only test selection is enabled

Source:
layer/VectorStyle.js
Returns:
Type
boolean

setAttributes(attr)

Set layer attributes

Parameters:
Name Type Description
attr Object | Array.<attributes>

attribute list or Array of attributes

Source:
layer/VectorStyle.js

setConditionStyle(conditions)

Set conditions to style the layer

Parameters:
Name Type Description
conditions Array.<conditionStyle>
Source:
layer/VectorStyle.js

setIgnStyle(property, val)

Set default ignStyle for a layer

Parameters:
Name Type Description
property string | ignStyle

the property to set

val string | number

the value to set

Source:
layer/VectorStyle.js

setMode( [mode], options)

Set render as an image

Parameters:
Name Type Argument Default Description
mode vector | image | cluster <optional>
vector

render mode

options *
Properties
Name Type Argument Description
clusterDistance number

cluster distance in px

clusterColor string

a color, default red / orange / green

clusterDash boolean

border is dash, default true

animationDuration number <optional>

cluster animation duration

maxZoomCluster number <optional>

limit zoom for cluster

Source:
layer/VectorStyle.js

setPopupContent(content)

Set popupcontent of the layer

Parameters:
Name Type Description
content string
Source:
layer/VectorStyle.js