control.RoutePanel

Extends IControl, ICustomizable.

The Route Panel control. The key of the control in the storage control.storage — "routePanelControl".

Constructor | Fields | Events | Methods

Constructor

control.RoutePanel([parameters])

Parameters:

Parameter

Default value

Description

parameters

Type: Object

Control parameters.

parameters.options

Type: Object

Control options. Use prefix 'routePanel' to configure underlying IRoutePanel options. 'routePanelAdjustMapMargin' option is set to true by default.

parameters.options.autofocus

true

Type: Boolean

Whether panel must automatically gain focus after it was added to map.

parameters.options.float

"left"

Type: String

The side to which you want to align the control. Can take three values: "left", "right" or "none". If set to "left" or "right", the controls are arranged one by one, starting from the left or right edge of the map, respectively. If set to "none", the controls are positioned according to the values of the left, right, bottom and top options, relative to the boundaries of the map. See also the description of the position option.

parameters.options.floatIndex

0

Type: Number

The priority of the control positioning. The element with highest priority is positioned closer to the map boundary that is specified in the float property. Does not work with float = "none".

parameters.options.maxWidth

'210px'

Type: String

Specifies CSS width of popup. Width is restricted by 176px below and 400px above.

parameters.options.position

Type: Object

Object describing the position of a control.

parameters.options.position.bottom

Type: Number|String

Position relative to the bottom edge of the map.

parameters.options.position.left

Type: Number|String

Position relative to the left edge of the map.

parameters.options.position.right

Type: Number|String

Position relative to the right edge of the map.

parameters.options.position.top

Type: Number|String

Position relative to the top edge of the map.

parameters.options.showHeader

false

Type: Boolean

Whether to show header.

parameters.options.title

'Routes'

Type: String

Title to show at the top of the panel. Visible only if showHeader option is true.

parameters.options.visible

true

Type: Boolean

Indicates if the control is displayed.

parameters.state

Type: Object

Object describing the state of a control.

Examples:

1.

// Example 1.
// Adding a route panel control to the map.
myMap.controls.add('routePanelControl')

2.

// Example 2.
// Creating 300px-wide route panel with header with filled starting point.
myMap.controls.add('routePanelControl', {
    maxWidth: 300,
});
var routePanel = myMap.controls.get('routePanelControl').routePanel;
routePanel.options.set('adjustMapMargin', true);
routePanel.state.set({
    fromEnabled: false,
    from: "moscow",
    to: "saint petersburg",
    type: "auto"
});

Fields

Name

Type

Description

events

IEventManager

Event manager.

Inherited from IEventEmitter.

options

IOptionManager

Options manager.

Inherited from IControl.

routePanel

IRoutePanel

Route panel.

Events

Name

Description

optionschange

Change to the object options.

Inherited from ICustomizable.

parentchange

The parent object reference changed.

Data fields:

  • oldParent - Old parent.
  • newParent - New parent.

Inherited from IChild.

Methods

Name

Returns

Description

getParent()

IControlParent|null

Returns link to the parent object, or null if the parent element was not set.

Inherited from IControl.

setParent(parent)

IChildOnMap

Sets the parent object. If the null value is passed, the manager element will only be deleted from the current parent object.

Inherited from IControl.

Fields details

routePanel

{IRoutePanel} routePanel

Route panel.