Documentation
Reference
2.1.56 (current version)
collection
interactivityModel
Interfaces
2.1.59 (release candidate)
collection
interactivityModel
Interfaces

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:

ParameterDefault valueDescription
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.adjustMapMargin false

Type: Boolean

Whether the control registers its size in the map margins manager map.margin.Manager.

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

NameTypeDescription
eventsIEventManager

Event manager.

Inherited from IEventEmitter.

optionsIOptionManager

Options manager.

Inherited from IControl.

routePanelIRoutePanel

Route panel.

Events

NameDescription
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

NameReturnsDescription
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.