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>
150Map width in screen pixels.
-
height
number
<optional>
150Map height in screen pixels.
-
width
number
<optional>
24Map width in collapsed state, in screen pixels.
-
height
number
<optional>
24Map height in collapsed state, in screen pixels.
-
toggleDisplay
boolean
<optional>
trueAdd a map toggle display button?
-
autoToggleDisplay
boolean
<optional>
falseAutomatically toggle the map display when hovering the map icon?
-
zoomLevelFixed
number
|false
<optional>
falseFixed extra map zoom level. Defaults to dynamic zooming.
-
zoomLevelOffset
number
<optional>
-5Zoom level offset with respect to that of the main map.
-
zoomAnimation
boolean
<optional>
falseAnimate 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.
-
title
Returns
-
ExtraMap
Instance of an extra map display/control interface.
Source
Methods
_addButton() → {object}
Add a button to the extra map window/icon.
Returns
-
object
Button element.
Source
_addToggleButton()
Add a display toggle button to the extra map window/icon.
Source
_decideMinimized()
Decide if the extra map must be minimized.
Source
_decideZoom(fromMaintoExtra)
Decide the extra map zoom level depending on current conditions.
Parameters
-
fromMaintoExtra
boolean
Is zooming triggered from the main map?
Source
_isDefined(value) → {boolean}
Testing for undefined
type.
Parameters
-
value
number
Input.
Returns
-
boolean
True if the input value is strictly
undefined
.
Source
_isInteger(value) → {boolean}
Testing for number
type.
Parameters
-
value
number
Input.
Returns
-
boolean
True if the input value is a number.
Source
_isZoomLevelFixed(e)
Update the main map as the extra map has stopped moving.
Parameters
-
e
leaflet.Event
Extra map
moveend
event.
Source
_minimize()
Minimize the extra map window.
Source
_onExtraMapMoveStarted(e)
Set up the aiming polygon footprint as the extra map starts moving.
Parameters
-
e
leaflet.Event
Extra map
movestart
event.
Source
_onExtraMapMoved(e)
Update the main map as the extra map has stopped moving.
Parameters
-
e
leaflet.Event
Extra map
moveend
event.
Source
_onExtraMapMoving(e)
Update the shadow polygon footprint as the extra map is moving.
Parameters
-
e
leaflet.Event
Extra map
move
event.
Source
_onMainMapMoved(e)
Follow the main map after it has moved.
Parameters
-
e
leaflet.Event
Main map
moveend
event.
Source
_onMainMapMoving(e)
Replicate the main map moves using the aiming polygon footprint.
Parameters
-
e
leaflet.Event
Main map
move
event.
Source
_restore()
Restore the extra map window.
Source
_setDisplay(minimize)
Toggle display of the extra map window.
Parameters
-
minimize
boolean
Minimize the map?
Source
_toggleDisplayButtonClicked()
Actions performed when the display toggle button is clicked.
Source
changeLayer(layeropt)
Update content when the layer is changed.
Parameters
-
layer
leaflet.Layer
<optional>
The new layer.
Source
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
onRemove(mapopt)
Remove map move event when the extra map display/control is removed.
Parameters
-
map
leaflet.map
<optional>
The parent map.