Polyline

Generate a polyline object and display it on the map.

Polyline

mogosmap.maps.Polyline({ option });

Parameters

Parameter (Required)
Description
Remark

path

Each {lat, lng} behaves as a node

JSON Array

Parameter (Optional)
Description
Remark

strokeColor

Specifies a hexadecimal HTML color of the format "#FFFFFF".

The Circle class does not support named colors.

The default is '#000000' specifies a hexadecimal HTML color of the format "#FFFFFF".

(Default : #000000)

Hex

strokeOpacity

Specifies a numerical value between 0.0 and 1.0 to determine the opacity of the line's color.

(Default : 1.0)

Numeric

strokeWeight

Specifies the width of the line in pixels.

(Default : 1)

String

message (popup)

Set the message of popup, type is string or HTML

String / HTML

event

Popup mouse event click or mouseover.

(Default : click)

String

anchor (popup)

A string indicating the part of the Marker that should be positioned closest to the coordinate set via Marker #setLngLat.

Options are 'center' , 'top' , 'bottom' , 'left' , 'right'.

(Default : bottom)

String

offset

(popup)

The offset in pixels as a PointLike object to apply relative to the element's center. Negatives indicate left and up. (Default : 15)

Numeric

closeButton (popup)

If true, a close button will appear in the top right corner of the popup.

(Default : false)

Boolean

coloseOnClick (popup)

If true, the popup closes when the map is clicked.

(Default : false)

Boolean

callback

A callback is a function passed as an argument to another function.

Function

Returns

Parameter
Description
Remark

Example

setMap

Parameters

Parameter (Required)
Description
Remark

null

Clear or destroy to generated polyline.

null

Returns

Parameter
Description
Remark

Example

addPolyline

Parameters

Parameter (Required)
Description
Remark

path

The shape of the polyline can be changed by setting new coordinates.

JSON Array

Returns

Parameter
Description
Remark

Example

setVisible

Parameter

Parameter (Required)
Description
Remark

modeShow

Show or hide the generated polyline on the map.

Boolean

Returns

Parameter
Description
Remark

Example

The MOGOS Maps API requires an API Key, which can be obtained from the MOGOS Console website or contact [email protected].

Last updated