Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MapOptions

Hierarchy

  • MapOptions

Index

Properties

Optional attributionControl

attributionControl: boolean

Whether the attribution control is added to the map by default.

Default value: true.

Optional bounceAtZoomLimits

bounceAtZoomLimits: boolean

Set it to false if you don't want the map to zoom beyond min/max zoom and then bounce back when pinch-zooming.

Default value: true.

Optional boxZoom

boxZoom: boolean

Whether the map can be zoomed to a rectangular area specified by dragging the mouse while pressing shift.

Default value: true.

Optional center

center: LatLng

Initial geographical center of the map.

Optional closePopupOnClick

closePopupOnClick: boolean

Set it to false if you don't want popups to close when user clicks the map.

Default value: true.

Optional crs

crs: ICRS

Coordinate Reference System to use. Don't change this if you're not sure what it means.

Default value: L.CRS.EPSG3857.

Optional doubleClickZoom

doubleClickZoom: boolean

Whether the map can be zoomed in by double clicking on it and zoomed out by double clicking while holding shift. If passed 'center', double-click zoom will zoom to the center of the view regardless of where the mouse was.

Default value: true.

Optional dragging

dragging: boolean

Whether the map be draggable with mouse/touch or not.

Default value: true.

Optional fadeAnimation

fadeAnimation: boolean

Whether the tile fade animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android.

Optional inertia

inertia: boolean

If enabled, panning of the map will have an inertia effect where the map builds momentum while dragging and continues moving in the same direction for some time. Feels especially nice on touch devices.

Default value: true.

Optional inertiaDeceleration

inertiaDeceleration: number

The rate with which the inertial movement slows down, in pixels/second2.

Default value: 3000.

Optional inertiaMaxSpeed

inertiaMaxSpeed: number

Max speed of the inertial movement, in pixels/second.

Default value: 1500.

Optional inertiaThreshold

inertiaThreshold: number

Amount of milliseconds that should pass between stopping the movement and releasing the mouse or touch to prevent inertial movement.

Default value: 32 for touch devices and 14 for the rest.

Optional keyboard

keyboard: boolean

Makes the map focusable and allows users to navigate the map with keyboard arrows and +/- keys.

Default value: true.

Optional keyboardPanOffset

keyboardPanOffset: number

Amount of pixels to pan when pressing an arrow key.

Default value: 80.

Optional keyboardZoomOffset

keyboardZoomOffset: number

Number of zoom levels to change when pressing + or - key.

Default value: 1.

Optional layers

layers: ILayer[]

Layers that will be added to the map initially.

Optional markerZoomAnimation

markerZoomAnimation: boolean

Whether markers animate their zoom with the zoom animation, if disabled they will disappear for the length of the animation. By default it's enabled in all browsers that support CSS3 Transitions except Android.

Optional maxBounds

maxBounds: LatLngBounds

When this option is set, the map restricts the view to the given geographical bounds, bouncing the user back when he tries to pan outside the view, and also not allowing to zoom out to a view that's larger than the given bounds (depending on the map size). To set the restriction dynamically, use setMaxBounds method

Optional maxZoom

maxZoom: number

Maximum zoom level of the map. This overrides any maxZoom set on map layers.

Optional minZoom

minZoom: number

Minimum zoom level of the map. Overrides any minZoom set on map layers.

Optional scrollWheelZoom

scrollWheelZoom: boolean

Whether the map can be zoomed by using the mouse wheel. If passed 'center', it will zoom to the center of the view regardless of where the mouse was.

Default value: true.

Optional tap

tap: boolean

Enables mobile hacks for supporting instant taps (fixing 200ms click delay on iOS/Android) and touch holds (fired as contextmenu events).

Default value: true.

Optional tapTolerance

tapTolerance: number

The max number of pixels a user can shift his finger during touch for it to be considered a valid tap.

Default value: 15.

Optional touchZoom

touchZoom: boolean

Whether the map can be zoomed by touch-dragging with two fingers.

Default value: true.

Optional trackResize

trackResize: boolean

Whether the map automatically handles browser window resize to update itself.

Default value: true.

Optional worldCopyJump

worldCopyJump: boolean

With this option enabled, the map tracks when you pan to another "copy" of the world and seamlessly jumps to the original one so that all overlays like markers and vector layers are still visible.

Default value: false.

Optional zoom

zoom: number

Initial map zoom.

Optional zoomAnimation

zoomAnimation: boolean

Whether the tile zoom animation is enabled. By default it's enabled in all browsers that support CSS3 Transitions except Android.

Optional zoomAnimationThreshold

zoomAnimationThreshold: number

Won't animate zoom if the zoom difference exceeds this value.

Default value: 4.

Optional zoomControl

zoomControl: boolean

Whether the zoom control is added to the map by default.

Default value: true.