Skip to content

LeafletGlMapOptions

LeafletGlMapOptions = object

Defined in: leaflet/map.ts:97

Map creation options. Compared to leaflet, several fields are omitted:

  • worldCopyJump: always true
  • zoomAnimationThreshold: irrelevant, zoom is always animated
  • fadeAnimation: always false, settings doesn't seem to have any effect in MapLibre
  • zoomAnimation: always true, animated zoom is non-issue in MapLibre
  • markerZoomAnimation

Properties

attributionControl?

optional attributionControl: boolean

Defined in: leaflet/map.ts:179

Whether attribution is displayed.


center?

optional center: LatLngExpression

Defined in: leaflet/map.ts:101

The initial center of the map.


closePopupOnClick?

optional closePopupOnClick: boolean

Defined in: leaflet/map.ts:164

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

Default

true

displayDuringZoom?

optional displayDuringZoom: boolean

Defined in: leaflet/map.ts:184

Optional setting to enable DOM-content being visibile (and updated) during zooming


doubleClickZoom?

optional doubleClickZoom: boolean

Defined in: leaflet/map.ts:205

Enable or disable double click zoom.

Default

true

dragging?

optional dragging: boolean

Defined in: leaflet/map.ts:217

Enable or disable drag panning.

Default

true

forceWebGL1?

optional forceWebGL1: boolean

Defined in: leaflet/map.ts:194

When true, WebGL1 will be used even when WebGL2 is available.


keyboard?

optional keyboard: boolean

Defined in: leaflet/map.ts:174

When true, allows the user to zoom and pan the map using the keyboard.


layers?

optional layers: Layer[]

Defined in: leaflet/map.ts:125

Layers of the map.


maxBounds?

optional maxBounds: Util.MapBounds | null

Defined in: leaflet/map.ts:133

When this option is set, the map restricts the view to the given geographical bounds, bouncing the user back if the user tries to pan outside the view. To set the restriction dynamically, use LeafletGlMap.setMaxBounds method.


maxCanvasRatio?

optional maxCanvasRatio: number | null

Defined in: leaflet/map.ts:189

Max allowed pixel ratio for CanvasLayer instances. Set to undefined for unlimited pixel ratio.


maxZoom?

optional maxZoom: number | null

Defined in: leaflet/map.ts:120

Maximum zoom level of the map. If not specified and at least one GridLayer or TileLayer is in the map, the highest of their maxZoom options will be used instead.


minZoom?

optional minZoom: number | null

Defined in: leaflet/map.ts:113

Minimum zoom level of the map. If not specified and at least one GridLayer or TileLayer is in the map, the lowest of their minZoom options will be used instead.


preferCanvas?

optional preferCanvas: boolean

Defined in: leaflet/map.ts:169

Whether to use canvas to render paths instead of SVG.


renderer?

optional renderer: RendererBase | null

Defined in: leaflet/map.ts:139

The default method for drawing vector layers on the map. SVGRenderer or CanvasRenderer by default depending on browser support.


scrollWheelZoom?

optional scrollWheelZoom: boolean | AroundCenterOptions

Defined in: leaflet/map.ts:211

Enable or disable scroll wheel zoom.

Default

true

touchZoom?

optional touchZoom: boolean | AroundCenterOptions

Defined in: leaflet/map.ts:223

Enable or disable touch zoom.

Default

true

zoom?

optional zoom: number

Defined in: leaflet/map.ts:106

The initial zoom level of the map.


zoomControl?

optional zoomControl: boolean

Defined in: leaflet/map.ts:199

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


zoomDelta?

optional zoomDelta: number

Defined in: leaflet/map.ts:158

Controls how much the map's zoom level will change after a LeafletGlMap.zoomIn, LeafletGlMap.zoomOut, pressing + or - on the keyboard, or using the zoom control. Values smaller than 1 (e.g. 0.5) allow for greater granularity.

Default

1

zoomSnap?

optional zoomSnap: number

Defined in: leaflet/map.ts:149

Forces the map's zoom level to always be a multiple of this, particularly right after a LeafletGlMap.fitBounds or a pinch-zoom. By default, the zoom level snaps to the nearest integer; lower values (e.g. 0.5 or 0.1) allow for greater granularity. A value of 0 means the zoom level will not be snapped after LeafletGlMap.fitBounds or a pinch-zoom.

Default

1