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

parentElement*

Type: String|HTMLElement

HTML element (or its ID) where the map will be created.

* Mandatory parameter/option.

Fields

Name

Type

Description

events

IEventManager

Event manager.

Inherited from IDomEventEmitter.

Events

Name

Description

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.

click

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.

contextmenu

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.

dblclick

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.

fullscreenenter

The map switched to fullscreen mode. Instance of the Event class.

fullscreenexit

The map exited full-screen mode. Instance of the Event class.

mousedown

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.

mouseenter

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.

mouseleave

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.

mousemove

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.

mouseup

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.

multitouchend

End of multitouch. This event is only available on devices that support multitouch. Returns an implementation of the IMultiTouchEvent interface.

Inherited from IDomEventEmitter.

multitouchmove

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:

  • clientX - X coordinate of the touch relative to the viewable area of the browser.
  • clientY - Y coordinate of the touch relative to the viewable area of the browser.
  • pageX - X coordinate of the touch relative to the beginning of the document.
  • pageY - Y coordinate of the touch relative to the beginning of the document.

Inherited from IDomEventEmitter.

multitouchstart

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:

  • clientX - X coordinate of the touch relative to the viewable area of the browser.
  • clientY - Y coordinate of the touch relative to the viewable area of the browser.
  • pageX - X coordinate of the touch relative to the beginning of the document.
  • pageY - Y coordinate of the touch relative to the beginning of the document.

Inherited from IDomEventEmitter.

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.

wheel

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

enterFullscreen()

Allows you to switch the map to full-screen mode.

exitFullscreen()

Allows you to take the map out of full-screen mode.

fitToViewport([preservePixelPosition])

Called when the size of the map container is changed so that the map applies the new size.

getElement()

HTMLElement

Returns map HTML element.

getOffset()

Number[]

Returns the shift of the map container in pixels, relative to the upper-left corner of the document.

getParentElement()

HTMLElement

Returns custom HTML element which contains the created map.

getSize()

Number[]

Returns size of the map container, in pixels.

isFullscreen()

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

preservePixelPosition

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.