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 |
— |
Type: Object Control parameters. |
|
— |
Type: Object Control options. Use prefix 'routePanel' to configure underlying IRoutePanel options. 'routePanelAdjustMapMargin' option is set to true by default. |
|
true |
Type: Boolean Whether panel must automatically gain focus after it was added to map. |
|
"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. |
|
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". |
|
'210px' |
Type: String Specifies CSS width of popup. Width is restricted by 176px below and 400px above. |
|
— |
Type: Object Object describing the position of a control. |
|
— |
Type: Number|String Position relative to the bottom edge of the map. |
|
— |
Type: Number|String Position relative to the left edge of the map. |
|
— |
Type: Number|String Position relative to the right edge of the map. |
|
— |
Type: Number|String Position relative to the top edge of the map. |
|
false |
Type: Boolean Whether to show header. |
|
'Routes' |
Type: String Title to show at the top of the panel. Visible only if showHeader option is true. |
|
true |
Type: Boolean Indicates if the control is displayed. |
|
— |
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 |
Event manager. Inherited from IEventEmitter. |
||
Options manager. Inherited from IControl. |
||
Route panel. |
Events
Name |
Description |
Change to the object options. Inherited from ICustomizable. |
|
The parent object reference changed. Data fields:
Inherited from IChild. |
Methods
Name |
Returns |
Description |
IControlParent|null |
Returns link to the parent object, or null if the parent element was not set. Inherited from IControl. |
|
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.