Class: FlowLine

ol.style. FlowLine

Flow line style Draw LineString with a variable color / width NB: the FlowLine style doesn't impress the hit-detection. If you want your lines to be sectionable you have to add your own style to handle this. (with transparent line: stroke color opacity to .1 or zero width)


new FlowLine(options)

Parameters:
Name Type Description
options Object
Properties
Name Type Argument Default Description
visible boolean

draw only the visible part of the line, default true

width number | function

Stroke width or a function that gets a feature and the position (beetween [0,1]) and returns current width

width2 number

Final stroke width (if width is not a function)

arrow number

Arrow at start (-1), at end (1), at both (2), none (0), default geta

color ol.colorLike | function

Stroke color or a function that gets a feature and the position (beetween [0,1]) and returns current color

color2 ol.colorLike

Final sroke color if color is nor a function

arrowColor ol.colorLike

Color of arrows, if not defined used color or color2

lineCap string

CanvasRenderingContext2D.lineCap 'butt' | 'round' | 'square', default 'butt'

arrowSize number | ol.size

height and width of the arrow, default 16

noOverlap boolean <optional>
false

prevent segments overlaping

offset0 number

offset at line start

offset1 number

offset at line end

Extends

Methods


_render(geom, e)

Renderer function

Parameters:
Name Type Description
geom Array.<ol.coordinate>

The pixel coordinates of the geometry in GeoJSON notation

e ol.render.State

The olx.render.State of the layer renderer


_splitAsize(geom, asize, end)

Split extremity at

Parameters:
Name Type Description
geom ol.geom.LineString
asize number
end boolean

start=false or end=true, default false (start)


_splitInto(geom, nb, nim)

Split line geometry into equal length geometries

Parameters:
Name Type Description
geom Array.<ol.coordinate>
nb number

number of resulting geometries, default 255

nim number

minimum length of the resulting geometries, default 1


getArrow()

Get arrow


getArrowSize()

getArrowSize

Returns:
Type
ol.size

getColor(feature, step)

Get the current color at step

Parameters:
Name Type Description
feature ol.feature
step number

current drawing step beetween [0,1]

Returns:
Type
string

getOffset(where)

Get offset at start or end

Parameters:
Name Type Description
where number

0=start, 1=end

Returns:

width

Type
number

getWidth(feature, step)

Get the current width at step

Parameters:
Name Type Description
feature ol.feature
step number

current drawing step beetween [0,1]

Returns:
Type
number

setArrow(n)

Set arrow

Parameters:
Name Type Description
n number

1 | 0 | 1 | 2, default: 0


setArrowColor(color)

Set the arrow color

Parameters:
Name Type Description
color ol.colorLike

setArrowSize(size)

setArrowSize

Parameters:
Name Type Description
size number | ol.size

setColor(color)

Set the initial color

Parameters:
Name Type Description
color ol.colorLike

setColor2(color)

Set the final color

Parameters:
Name Type Description
color ol.colorLike

setLineCap(cap)

Set the LineCap

Parameters:
Name Type Description
cap steing

LineCap (round or butt), default butt


setOffset(width, where)

Add an offset at start or end

Parameters:
Name Type Description
width number
where number

0=start, 1=end


setWidth(width)

Set the initial width

Parameters:
Name Type Description
width number

width, default 0


setWidth2(width)

Set the final width

Parameters:
Name Type Description
width number

width, default 0