class
Control
Class for the map's controls creating.
(map, content, options)Example:
const control = new mapgl.Control(
map,
'<button>Some text</button>',
{ position: 'topLeft' },
);
The map instance.
Control HTML content.
Control options.
Destroys the control.
Returns the container of the control.
Returns the position of the control.
(position)Sets the position of the control.
Required position of the control.
Evented
Event emitter
(type, data?)Calls all event listeners with event type
type
Event type
Data transferred to events
(type, listener)Removes event listener registered with
on
Event type
Event handler
(type, listener)Registers event listener
Event type
Event handler
(type, listener)Registers event listener which will be called once
Event type
Event handler
Ruler
A class that provides ruler functionality.
(map, options)Example:
const ruler = new mapgl.Ruler(map, {});
ruler.setPoints([
[55.31878, 25.23584],
[55.35878, 25.23584],
[55.35878, 25.26584],
]);
Destroys the ruler.
Disables the ruler display.
(type, data?)Calls all event listeners with event type
type
Event type
Data transferred to events
Enables the ruler display.
(type, listener)Removes event listener registered with
on
Event type
Event handler
(type, listener)Registers event listener
Event type
Event handler
(type, listener)Registers event listener which will be called once
Event type
Event handler
(settings)Set labels visibility.
(points)Sets new points. This overrides the previous points.
An array of geographical points [longitude, latitude].
RulerControl
A class that provides a ruler control on the map.
(map, options)Example:
const control = new mapgl.RulerControl(map, {{ position: 'centerRight' }});
control.getRuler().setPoints([
[55.31878, 25.23584],
[55.35878, 25.23584],
[55.35878, 25.26584],
]);
The map instance.
Ruler control initialization options.
Destroys the control and the ruler.
Returns the container of the control.
Returns the position of the control.
Returns the ruler instance.
(position)Sets the position of the control.
Required position of the control.
Toggle control. The same as clicking the control button.