Class: Compass

ol.control. Compass

Draw a compass on the map. The position/size of the control is defined in the css.


new Compass( [options])

Parameters:
Name Type Argument Description
options Object <optional>

Control options. The style {ol_style_Stroke} option is usesd to draw the text.

Properties
Name Type Argument Default Description
className string

class name for the control

visible boolean <optional>
true
image Image

an image, default use the src option or a default image

src string

image src or 'default' or 'compact', default use the image option or a default image

rotateVithView boolean

rotate vith view (false to show watermark), default true

style ol.style.Stroke

style to draw the lines, default draw no lines

Extends

Methods


getCanvas()

Get canvas overlay

Inherited From:
Overrides:

getFill()

Get fill

Inherited From:
Overrides:

getStroke()

Get stroke

Inherited From:
Overrides:

getStyle()

Get style

Inherited From:
Overrides:

getTextFill()

Get text fill

Inherited From:
Overrides:

getTextFont()

Get text font

Inherited From:
Overrides:

getTextStroke()

Get stroke

Inherited From:
Overrides:

getVisible()

Get control visibility

Returns:
Type
boolean

setImage( [img])

Set compass image

Parameters:
Name Type Argument Default Description
img Image | string <optional>
default

the image or an url or 'compact' or 'default'


setMap(map)

Remove the control from its current map and attach it to the new map. Subclasses may set up event handlers to get notified about changes to the map here.

Parameters:
Name Type Description
map ol.Map

Map.

Inherited From:
Overrides:

setStyle()

Set Style

Inherited From:
Overrides:

setVisible(b)

Set visibility

Parameters:
Name Type Description
b boolean