control.FullscreenControl
Extends control.Button.
The "Fullscreen mode" control. You can set the z-index property of the map container for full-screen mode using the Map.options.fullscreenZIndex option. Key for the control in control.storage — "fullscreenControl".
Constructor | Fields | Events | Methods
Constructor
control.FullscreenControl([parameters])
Parameters:
Parameter |
Default value |
Description |
— |
Type: Object Control parameters. |
|
— |
Type: Object Object describing the data of a control. |
|
— |
Type: String Text of the popup hint that appears when the mouse cursor hovers over the button. |
|
— |
Type: Object Control options. |
|
false |
Type: Boolean Whether the control registers its size in the map margins manager map.margin.Manager. |
|
"right" |
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. |
|
300 |
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". See also the description of the position option. |
|
— |
Type: ISelectableControlLayout|String Constructor of the control layout which implements the ISelectableControlLayout interface or the layout key in the layout.storage. The layout constructor is passed an object containing the fields:
|
|
28 |
Type: Number|Number[] The maximum width of the control in different states. If a number is specified, it is assumed that the control has the same maximum dimensions in all states. If an array is specified, it will be interpreted as the maximum width in different states from the lesser to the greater. The number of states is set in the instance of the class control.Manager, which is usually a field of Map.controls, via the "states" option. By default, the controls have three states ['small', 'medium', 'large']. By default, the control does not change its size and always looks like a button with an icon. |
|
— |
Type: Object Object describing the position of a control. If the position option is set, the float option value is automatically treated as "none". |
|
'auto' |
Type: Number|String Position relative to the bottom edge of the map. |
|
'auto' |
Type: Number|String Position relative to the left edge of the map. |
|
'auto' |
Type: Number|String Position relative to the right edge of the map. |
|
'auto' |
Type: Number|String Position relative to the top edge of the map. |
|
true |
Type: Boolean Indicates if the control is displayed. |
|
— |
Type: Object Object describing the state of a control. |
|
true |
Type: Boolean Flags if the button is active. |
|
false |
Type: Boolean Flags if the button is pressed. |
Example:
// Adding the control to the map and immediately switching it
// to the full-screen mode.
var fullscreenControl = new ymaps.control.FullscreenControl();
myMap.controls.add(fullscreenControl);
fullscreenControl.enterFullscreen();
Fields
Name |
Type |
Description |
Button data. Names of fields that are available via the data.Manager.get method:
Inherited from control.Button. |
||
Event manager. Inherited from IEventEmitter. |
||
Options manager. Inherited from IControl. |
||
The event indicating that the button has been pressed. Unlike the click event, it is generated only if the state isEnabled == true. Instance of the Event class. Inherited from control.Button. |
||
State of the control. Names of fields that are available via the data.Manager.get method:
|
Events
Name |
Description |
Clicking the button. Instance of the Event class. Inherited from control.Button. |
|
The control is not selected. Inherited from ISelectableControl. |
|
The control is unavailable. Inherited from ISelectableControl. |
|
The control is available. Inherited from ISelectableControl. |
|
The map switched to fullscreen mode. Instance of the Event class. |
|
The map exited full-screen mode. Instance of the Event class. |
|
Change to the object options. Inherited from ICustomizable. |
|
The parent object reference changed. Data fields:
Inherited from IChild. |
|
The control is selected. Inherited from ISelectableControl. |
Methods
Name |
Returns |
Description |
deselect() |
Cancels selection of the control (turns it off). Inherited from ISelectableControl. |
|
disable() |
Makes the control unavailable (user actions are not allowed). Inherited from ISelectableControl. |
|
enable() |
Makes the control available (user actions are allowed). Inherited from ISelectableControl. |
|
Allows you to switch the map to full-screen mode. |
||
Allows you to take the map out of full-screen mode. |
||
getMap() |
Returns reference to the map. Inherited from control.Button. |
|
IControlParent|null |
Returns link to the parent object, or null if the parent element was not set. Inherited from IControl. |
|
Boolean |
Returns true if the control is available, or false if it is unavailable. Inherited from ISelectableControl. |
|
Boolean |
Returns true if the control is selected, or false if it is not selected. Inherited from ISelectableControl. |
|
select() |
Selects (turns on) the control. Inherited from ISelectableControl. |
|
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
state
{data.Manager} state
State of the control. Names of fields that are available via the data.Manager.get method:
- fullscreen — Flag for whether the map is in full-screen mode.
Events details
fullscreenenter
The map switched to fullscreen mode. Instance of the Event class.
fullscreenexit
The map exited full-screen mode. Instance of the Event class.
Methods details
enterFullscreen
{} enterFullscreen()
Allows you to switch the map to full-screen mode.
exitFullscreen
{} exitFullscreen()
Allows you to take the map out of full-screen mode.