VisiOmatic web client

Class

ExtraMap

Extends
  • leaflet.Control

new ExtraMap(layer, optionsopt) → {ExtraMap}

Create an extra map display/control interface.

Parameters

  • layer leaflet.Layer

    Layer displayed in the extra map.

  • options object <optional>

    Options.

    Properties

    • title string <optional>
      'Navigation mini-map. Grab to navigate'

      Title of the map.

    • position 'bottomleft' | 'bottomright' | 'topleft' | 'topright' <optional>
      'topright'

      Position of the map.

    • width number <optional>
      150

      Map width in screen pixels.

    • height number <optional>
      150

      Map height in screen pixels.

    • width number <optional>
      24

      Map width in collapsed state, in screen pixels.

    • height number <optional>
      24

      Map height in collapsed state, in screen pixels.

    • toggleDisplay boolean <optional>
      true

      Add a map toggle display button?

    • autoToggleDisplay boolean <optional>
      false

      Automatically toggle the map display when hovering the map icon?

    • zoomLevelFixed number | false <optional>
      false

      Fixed extra map zoom level. Defaults to dynamic zooming.

    • zoomLevelOffset number <optional>
      -5

      Zoom level offset with respect to that of the main map.

    • zoomAnimation boolean <optional>
      false

      Animate when zooming in/out (warning: adds some lag)?

    • aimingRectOptions rectangleOptions <optional>

      Display options for the aiming rectangle.

    • shadowRectOptions rectangleOptions <optional>

      Display options for the shadow rectangle.

Returns

  • ExtraMap

    Instance of an extra map display/control interface.

Source

Methods

privatestatic

_addButton() → {object}

Add a button to the extra map window/icon.

Returns

  • object

    Button element.

Source

privatestatic

_decideZoom(fromMaintoExtra)

Decide the extra map zoom level depending on current conditions.

Parameters

  • fromMaintoExtra boolean

    Is zooming triggered from the main map?

Source

privatestatic

_isDefined(value) → {boolean}

Testing for undefined type.

Parameters

  • value number

    Input.

Returns

  • boolean

    True if the input value is strictly undefined.

Source

privatestatic

_isInteger(value) → {boolean}

Testing for number type.

Parameters

  • value number

    Input.

Returns

  • boolean

    True if the input value is a number.

Source

privatestatic

_isZoomLevelFixed(e)

Update the main map as the extra map has stopped moving.

Parameters

  • e leaflet.Event

    Extra map moveend event.

Source

privatestatic

_onExtraMapMoveStarted(e)

Set up the aiming polygon footprint as the extra map starts moving.

Parameters

  • e leaflet.Event

    Extra map movestart event.

Source

privatestatic

_onExtraMapMoved(e)

Update the main map as the extra map has stopped moving.

Parameters

  • e leaflet.Event

    Extra map moveend event.

Source

privatestatic

_onExtraMapMoving(e)

Update the shadow polygon footprint as the extra map is moving.

Parameters

  • e leaflet.Event

    Extra map move event.

Source

privatestatic

_onMainMapMoved(e)

Follow the main map after it has moved.

Parameters

  • e leaflet.Event

    Main map moveend event.

Source

privatestatic

_onMainMapMoving(e)

Replicate the main map moves using the aiming polygon footprint.

Parameters

  • e leaflet.Event

    Main map move event.

Source

privatestatic

_setDisplay(minimize)

Toggle display of the extra map window.

Parameters

  • minimize boolean

    Minimize the map?

Source

static

changeLayer(layeropt)

Update content when the layer is changed.

Parameters

  • layer leaflet.Layer <optional>

    The new layer.

Source

static

onAdd(map) → {object}

Add the extra map display/control directly to the map and wait for the layer to be ready.

Parameters

  • map object

    Leaflet map the control has been added to.

Returns

  • object

    The newly created container of the control.

Source

static

onRemove(mapopt)

Remove map move event when the extra map display/control is removed.

Parameters

  • map leaflet.map <optional>

    The parent map.

Source