map.Container
Extends IDomEventEmitter.
Map container manager. Each map already has its own container manager, available as map.container. Don't instantiate new instances of this class unless necessary.
See Map.container
Constructor | Fields | Events | Methods
Constructor
map.Container(parentElement)
Parameters:
Parameter |
Default value |
Description |
— |
Type: String|HTMLElement HTML element (or its ID) where the map will be created. |
* Mandatory parameter/option.
Fields
Name |
Type |
Description |
Event manager. Inherited from IDomEventEmitter. |
Events
Name |
Description |
The event preceding the "fullscreenexit" event. If the Event.preventDefault method is called for this event, a subsequent fullscreenexit event will be canceled. Instance of the Event class. |
|
Single left-click on the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
Calls the element's context menu. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
Double left-click on the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
The map switched to fullscreen mode. Instance of the Event class. |
|
The map exited full-screen mode. Instance of the Event class. |
|
Pressing the mouse button over the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
Pointing the cursor at the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
Moving the cursor off of the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
Moving the cursor over the object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
Letting go of the mouse button over an object. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
|
End of multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface. Inherited from IDomEventEmitter. |
|
Repeating event during multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface with information about touches. Defines the touches property, which contains a list of touches. Every touch is described by an object that contains the following fields:
Inherited from IDomEventEmitter. |
|
Start of multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface with information about touches. Defines the touches property, which contains a list of touches. Every touch is described by an object that contains the following fields:
Inherited from IDomEventEmitter. |
|
Change to the size of the map container. Instance of the Event class. Names of fields that are available via the Event.get method:
|
|
Mouse wheel scrolling. When using, keep in mind that mouse events are emulated when a touch screen is used. Instance of the MapEvent class. More information is available in domEvent.manager. Inherited from IDomEventEmitter. |
Methods
Name |
Returns |
Description |
Allows you to switch the map to full-screen mode. |
||
Allows you to take the map out of full-screen mode. |
||
Called when the size of the map container is changed so that the map applies the new size. |
||
HTMLElement |
Returns map HTML element. |
|
Number[] |
Returns the shift of the map container in pixels, relative to the upper-left corner of the document. |
|
HTMLElement |
Returns custom HTML element which contains the created map. |
|
getSize() |
Number[] |
Returns size of the map container, in pixels. |
Boolean |
Returns indicates whether the map is in full-screen mode. |
Events details
beforefullscreenexit
The event preceding the "fullscreenexit" event. If the Event.preventDefault method is called for this event, a subsequent fullscreenexit event will be canceled. Instance of the Event class.
fullscreenenter
The map switched to fullscreen mode. Instance of the Event class.
fullscreenexit
The map exited full-screen mode. Instance of the Event class.
sizechange
Change to the size of the map container. Instance of the Event class. Names of fields that are available via the Event.get method:
- oldSize: Number[];
- newSize: Number[];
- oldOffset: Number[];
- newOffset: Number[];
- preservePixelPosition: Boolean.
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.
fitToViewport
{} fitToViewport([preservePixelPosition])
Called when the size of the map container is changed so that the map applies the new size.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Boolean Save the location of the map center. |
Example:
// Changing the dimensions of the map container
map.container.getElement().style.width = '300px';
// Initializing size recalculation
map.container.fitToViewport();
getElement
{HTMLElement} getElement()
Returns map HTML element.
getOffset
{Number[]} getOffset()
Returns the shift of the map container in pixels, relative to the upper-left corner of the document.
getParentElement
{HTMLElement} getParentElement()
Returns custom HTML element which contains the created map.
getSize
{Number[]} getSize()
Returns size of the map container, in pixels.
isFullscreen
{Boolean} isFullscreen()
Returns indicates whether the map is in full-screen mode.
Mandatory parameter/option.