API Docs for: 0.1.1
Show:

flatworld.extensions.baseEventlisteners Class

Core plugin. Houses the default eventlisteners used in the map. When plugins are added to the map this class can be used for the eventlistener management. Creates window.flatworld.setFullScreen function to be used when switching to fullscreen.

Methods

_resizeCanvas

() private

Resizes the canvas to the current most wide and high element status. Basically canvas size === window size.

_setFullScreen

() private

Activate the browsers fullScreen mode and expand the canvas to fullsize

toggleDrag

(
  • cb
)
Boolean

DragListener (normally used for moving the map)

Parameters:

  • cb Function

    Callback that fires when this event activates

Returns:

Boolean:

Return the state of this event

toggleFullscreen

(
  • cb
)
Boolean

Sets the browser in fullscreen mode.

Parameters:

  • cb Function

    Callback that fires when this event activates

Returns:

Boolean:

Return the state of this event

toggleFullSize

()

Sets the canvas to fullsize as in the same size of the window / content area. But not fullscreen. Note that

toggleMouseTextSelection

()

Deactivate the selection of text, by dragging

toggleOrder

(
  • cb
)
Boolean

Selecting something from the map. With mouse you can use the default right click and in touch devices you can use continuous press event (keeping the finger pressed on the screen for a preset time).

Parameters:

  • cb Function

    Callback that fires when this event activates

Returns:

Boolean:

Return the state of this event

toggleSelect

(
  • cb
)
Boolean

Selecting something from the map

Parameters:

  • cb Function

    Callback that fires when this event activates

Returns:

Boolean:

Return the state of this event

toggleZoom

(
  • cb
)
Boolean

Zoom the map. Mousewheel (desktop) and pinch (mobile)

Parameters:

  • cb Function

    Callback that fires when this event activates

Returns:

Boolean:

Return the state of this event

Attributes

pluginName

String

Plugins name

Fires event pluginNameChange

Fires when the value for the configuration attribute pluginName is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.