` element or the element
* itself, and optionally an object literal with `MaplairMap` options.
* @param {string|HTMLElement} id The `
` element or its DOM ID.
* @param {MaplairMapOptions} [options]
*/
constructor(id: string | HTMLElement, options?: MaplairMapOptions);
/**
* Sets the view of the map (geographical center and zoom) with the given
* animation options.
* @group Methods for modifying map state
* @param {LatLngExpression} center
* @param {number} [zoom]
* @param {ZoomPanOptions} [options]
* @returns {this}
*/
setView(center: LatLngExpression, zoom?: number, options?: ZoomPanOptions): this;
/**
* Sets the zoom of the map.
* @group Methods for modifying map state
* @param {number} zoom
* @param {ZoomPanOptions} [options]
* @returns {this}
*/
setZoom(zoom: number, options?: ZoomPanOptions): this;
/**
* Increases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).
* @group Methods for modifying map state
* @param {number} [delta]
* @param {ZoomOptions} [options]
* @returns {this}
*/
zoomIn(delta?: number, options?: ZoomOptions): this;
/**
* Decreases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).
* @group Methods for modifying map state
* @param {number} [delta]
* @param {ZoomOptions} [options]
* @returns {this}
*/
zoomOut(delta?: number, options?: ZoomOptions): this;
/**
* Zooms the map while keeping a specified geographical point on the map
* stationary (e.g. used internally for scroll zoom and double-click zoom). Given a
* `Point`, it keeps the specified pixel on the map (relative to the top-left corner)
* stationary instead.
* @group Methods for modifying map state
* @param {LatLngExpression|Point} latlng The geographical point or the pixel offset.
* @param {number} zoom
* @param {ZoomOptions} [options]
* @returns {this}
*/
setZoomAround(latlng: LatLngExpression | Point, zoom: number, options?: ZoomOptions): this;
/**
* Sets a map view that contains the given geographical bounds with the
* maximum zoom level possible.
* @group Methods for modifying map state
* @param {LatLngBoundsExpression} bounds
* @param {FitBoundsOptions} [options]
* @returns {this}
*/
fitBounds(bounds: LatLngBoundsExpression, options?: FitBoundsOptions): this;
/**
* Sets a map view that mostly contains the whole world with the maximum
* zoom level possible.
* @group Methods for modifying map state
* @param {FitBoundsOptions} [options]
* @returns {this}
*/
fitWorld(options?: FitBoundsOptions): this;
/**
* Pans the map to a given center.
* @group Methods for modifying map state
* @param {LatLngExpression} center
* @param {PanOptions} [options]
* @returns {this}
*/
panTo(center: LatLngExpression, options?: PanOptions): this;
/**
* Pans the map by a given number of pixels (animated unless `animate: false` is passed,
* or the user prefers reduced motion and the pan is longer than half the map size
* without `animate: true`).
* @group Methods for modifying map state
* @param {PointExpression} offset
* @param {PanOptions} [options]
* @returns {this}
*/
panBy(offset: PointExpression, options?: PanOptions): this;
/**
* Sets the view of the map (geographical center and zoom) performing a smooth
* pan-zoom animation. If the user prefers reduced motion (and `animate: true` isn't
* passed), it behaves like `setView` instead, only animating short pans and zooms.
* @group Methods for modifying map state
* @param {LatLngExpression} targetCenter
* @param {number} [targetZoom]
* @param {ZoomPanOptions} [options]
* @returns {this}
*/
flyTo(targetCenter: LatLngExpression, targetZoom?: number, options?: ZoomPanOptions): this;
/**
* Sets the view of the map with a smooth animation like [`flyTo`](#map-flyto),
* but takes a bounds parameter like [`fitBounds`](#map-fitbounds).
* @group Methods for modifying map state
* @param {LatLngBoundsExpression} bounds
* @param {FitBoundsOptions} [options]
* @returns {this}
*/
flyToBounds(bounds: LatLngBoundsExpression, options?: FitBoundsOptions): this;
/**
* Changes the [Coordinate Reference System](#crs) of the map, keeping its center
* and (as far as possible with the zoom levels and `zoomSnap`) its scale at the
* center. All layers are redrawn in the new CRS; note that tile layers only work
* with the CRS their tiles were made for.
* @group Methods for modifying map state
* @param {CRS} crs
* @returns {this}
*/
setCrs(crs: CRS): this;
/**
* Restricts the map view to the given bounds (see the [maxBounds](#map-maxbounds) option).
* @group Methods for modifying map state
* @param {LatLngBoundsExpression} bounds
* @returns {this}
*/
setMaxBounds(bounds: LatLngBoundsExpression): this;
/**
* Sets the lower limit for the available zoom levels (see the [minZoom](#map-minzoom) option).
* @group Methods for modifying map state
* @param {number} zoom
* @returns {this}
*/
setMinZoom(zoom: number): this;
/**
* Sets the upper limit for the available zoom levels (see the [maxZoom](#map-maxzoom) option).
* @group Methods for modifying map state
* @param {number} zoom
* @returns {this}
*/
setMaxZoom(zoom: number): this;
/**
* Pans the map to the closest view that would lie inside the given bounds (if
* it's not already), controlling the animation using the options specific, if any.
* @group Methods for modifying map state
* @param {LatLngBoundsExpression} bounds
* @param {PanOptions} [options]
* @returns {this}
*/
panInsideBounds(bounds: LatLngBoundsExpression, options?: PanOptions): this;
/**
* Pans the map the minimum amount to make the `latlng` visible. Use
* padding options to fit the display to more restricted bounds.
* If `latlng` is already within the (optionally padded) display bounds,
* the map will not be panned.
* @group Methods for modifying map state
* @param {LatLngExpression} latlng
* @param {PaddingOptions & PanOptions} [options]
* @returns {this}
*/
panInside(latlng: LatLngExpression, options?: PaddingOptions & PanOptions): this;
/**
* Checks if the map container size changed and updates the map if so —
* call it after you've changed the map size dynamically, also panning to
* keep the center by default. If `options.pan` is `false`, panning will not occur.
* If `options.debounceMoveend` is `true`, it will delay `moveend` event so
* that it doesn't happen often even if the method is called many
* times in a row. Passing `true` instead of options animates the panning.
* @group Methods for modifying map state
* @param {InvalidateSizeOptions|boolean} [options]
* @returns {this}
*/
invalidateSize(options?: InvalidateSizeOptions | boolean): this;
/**
* Stops the currently running `panTo` or `flyTo` animation, if any.
* @group Methods for modifying map state
* @returns {this}
*/
stop(): this;
/**
* Tries to locate the user using the Geolocation API, firing a
* [`locationfound`](#map-locationfound) event with location data on success or a
* [`locationerror`](#map-locationerror) event on failure, and optionally sets the map
* view to the user's location with respect to detection accuracy (or to the world view
* if geolocation failed).
* Note that, if your page doesn't use HTTPS, this method will fail in
* modern browsers ([Chrome 50 and newer](https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins))
* See `LocateOptions` for more details.
* @group Geolocation methods
* @param {LocateOptions} [options]
* @returns {this}
*/
locate(options?: LocateOptions): this;
/**
* Stops watching location previously initiated by `map.locate({watch: true})`
* and aborts resetting the map view if map.locate was called with
* `{setView: true}`.
* @group Geolocation methods
* @returns {this}
*/
stopLocate(): this;
/**
* Adds a new `Handler` to the map, given its name and constructor function.
* @group Other methods
* @param {string} name
* @param {new (map: MaplairMap) => Handler} HandlerClass
* @returns {this}
*/
addHandler(name: string, HandlerClass: new (map: MaplairMap) => Handler): this;
/**
* Destroys the map and clears all related event listeners.
* @group Other methods
* @returns {this}
*/
remove(): this;
/**
* Creates a new [map pane](#map-pane) with the given name if it doesn't exist already,
* then returns it. The pane is created as a child of `container`, or
* as a child of the main map pane if not set.
* @group Other methods
* @param {string} name
* @param {HTMLElement} [container]
* @returns {HTMLElement}
*/
createPane(name: string, container?: HTMLElement): HTMLElement;
/**
* Returns the geographical center of the map view.
* @group Methods for getting map state
* @returns {LatLng}
*/
getCenter(): LatLng;
/**
* Returns the current zoom level of the map view.
* @group Methods for getting map state
* @returns {number}
*/
getZoom(): number;
/**
* Returns the geographical bounds visible in the current map view.
* @group Methods for getting map state
* @returns {LatLngBounds}
*/
getBounds(): LatLngBounds;
/**
* Returns the minimum zoom level of the map (if set in the `minZoom` option of the
* map or of any layers), or `0` by default.
* @group Methods for getting map state
* @returns {number}
*/
getMinZoom(): number;
/**
* Returns the maximum zoom level of the map (if set in the `maxZoom` option of the
* map or of any layers).
* @group Methods for getting map state
* @returns {number}
*/
getMaxZoom(): number;
/**
* Returns the maximum zoom level on which the given bounds fit to the map
* view in its entirety. If `inside` (optional) is set to `true`, the method
* instead returns the minimum zoom level on which the map view fits into
* the given bounds in its entirety.
* @group Methods for getting map state
* @param {LatLngBoundsExpression} bounds
* @param {boolean} [inside]
* @param {PointExpression} [padding]
* @returns {number}
*/
getBoundsZoom(bounds: LatLngBoundsExpression, inside?: boolean, padding?: PointExpression): number;
/**
* Returns the current size of the map container (in pixels).
* @group Methods for getting map state
* @returns {Point}
*/
getSize(): Point;
/**
* Returns the bounds of the current map view in projected pixel
* coordinates (sometimes useful in layer and overlay implementations).
* If `center` and `zoom` is omitted, the map's current zoom level and center is used.
* @group Methods for getting map state
* @param {LatLngExpression} [center]
* @param {number} [zoom]
* @returns {Bounds}
*/
getPixelBounds(center?: LatLngExpression, zoom?: number): Bounds;
/**
* Returns the projected pixel coordinates of the top left point of
* the map layer (useful in custom layer and overlay implementations).
* @group Methods for getting map state
* @returns {Point}
*/
getPixelOrigin(): Point;
/**
* Returns the world's bounds in pixel coordinates for zoom level `zoom`.
* If `zoom` is omitted, the map's current zoom level is used.
* @group Methods for getting map state
* @param {number} [zoom]
* @returns {Bounds|null} `null` for CRSs with infinite bounds.
*/
getPixelWorldBounds(zoom?: number): Bounds | null;
/**
* Returns a [map pane](#map-pane), given its name or its HTML element (its identity).
* @group Other methods
* @param {string|HTMLElement} pane
* @returns {HTMLElement}
*/
getPane(pane: string | HTMLElement): HTMLElement;
/**
* Returns a plain object containing the names of all [panes](#map-pane) as keys and
* the panes as values.
* @group Other methods
* @returns {Record}
*/
getPanes(): Record;
/**
* Returns the HTML element that contains the map.
* @group Other methods
* @returns {HTMLElement}
*/
getContainer(): HTMLElement;
/**
* Returns the scale factor to be applied to a map transition from zoom level
* `fromZoom` to `toZoom`. Used internally to help with zoom animations.
* @group Conversion methods
* @param {number} toZoom
* @param {number} [fromZoom]
* @returns {number}
*/
getZoomScale(toZoom: number, fromZoom?: number): number;
/**
* Returns the zoom level that the map would end up at, if it is at `fromZoom`
* level and everything is scaled by a factor of `scale`. Inverse of
* [`getZoomScale`](#map-getZoomScale).
* @group Conversion methods
* @param {number} scale
* @param {number} [fromZoom]
* @returns {number}
*/
getScaleZoom(scale: number, fromZoom?: number): number;
/**
* Projects a geographical coordinate `LatLng` according to the projection
* of the map's CRS, then scales it according to `zoom` and the CRS's
* `Transformation`. The result is pixel coordinate relative to
* the CRS origin.
* @group Conversion methods
* @param {LatLngExpression} latlng
* @param {number} [zoom]
* @returns {Point}
*/
project(latlng: LatLngExpression, zoom?: number): Point;
/**
* Inverse of [`project`](#map-project).
* @group Conversion methods
* @param {PointExpression} point
* @param {number} [zoom]
* @returns {LatLng}
*/
unproject(point: PointExpression, zoom?: number): LatLng;
/**
* Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),
* returns the corresponding geographical coordinate (for the current zoom level).
* @group Conversion methods
* @param {PointExpression} point
* @returns {LatLng}
*/
layerPointToLatLng(point: PointExpression): LatLng;
/**
* Given a geographical coordinate, returns the corresponding pixel coordinate
* relative to the [origin pixel](#map-getpixelorigin).
* @group Conversion methods
* @param {LatLngExpression} latlng
* @returns {Point}
*/
latLngToLayerPoint(latlng: LatLngExpression): Point;
/**
* Returns a `LatLng` where `lat` and `lng` has been wrapped according to the
* map's CRS's `wrapLat` and `wrapLng` properties, if they are outside the
* CRS's bounds.
* By default this means longitude is wrapped around the dateline so its
* value is between -180 and +180 degrees.
* @group Conversion methods
* @param {LatLngExpression} latlng
* @returns {LatLng}
*/
wrapLatLng(latlng: LatLngExpression): LatLng;
/**
* Returns a `LatLngBounds` with the same size as the given one, ensuring that
* its center is within the CRS's bounds.
* By default this means the center longitude is wrapped around the dateline so its
* value is between -180 and +180 degrees, and the majority of the bounds
* overlaps the CRS's bounds.
* @group Conversion methods
* @param {LatLngBoundsExpression} bounds
* @returns {LatLngBounds}
*/
wrapLatLngBounds(bounds: LatLngBoundsExpression): LatLngBounds;
/**
* Returns the distance between two geographical coordinates according to
* the map's CRS. By default this measures distance in meters.
* @group Conversion methods
* @param {LatLngExpression} latlng1
* @param {LatLngExpression} latlng2
* @returns {number}
*/
distance(latlng1: LatLngExpression, latlng2: LatLngExpression): number;
/**
* Given a pixel coordinate relative to the map container, returns the corresponding
* pixel coordinate relative to the [origin pixel](#map-getpixelorigin).
* @group Conversion methods
* @param {PointExpression} point
* @returns {Point}
*/
containerPointToLayerPoint(point: PointExpression): Point;
/**
* Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),
* returns the corresponding pixel coordinate relative to the map container.
* @group Conversion methods
* @param {PointExpression} point
* @returns {Point}
*/
layerPointToContainerPoint(point: PointExpression): Point;
/**
* Given a pixel coordinate relative to the map container, returns
* the corresponding geographical coordinate (for the current zoom level).
* @group Conversion methods
* @param {PointExpression} point
* @returns {LatLng}
*/
containerPointToLatLng(point: PointExpression): LatLng;
/**
* Given a geographical coordinate, returns the corresponding pixel coordinate
* relative to the map container.
* @group Conversion methods
* @param {LatLngExpression} latlng
* @returns {Point}
*/
latLngToContainerPoint(latlng: LatLngExpression): Point;
/**
* Given a PointerEvent object, returns the pixel coordinate relative to the
* map container where the event took place.
* @group Conversion methods
* @param {MouseEvent|PointerEvent} e
* @returns {Point}
*/
pointerEventToContainerPoint(e: MouseEvent | PointerEvent): Point;
/**
* Given a PointerEvent object, returns the pixel coordinate relative to
* the [origin pixel](#map-getpixelorigin) where the event took place.
* @group Conversion methods
* @param {MouseEvent|PointerEvent} e
* @returns {Point}
*/
pointerEventToLayerPoint(e: MouseEvent | PointerEvent): Point;
/**
* Given a PointerEvent object, returns geographical coordinate where the
* event took place.
* @group Conversion methods
* @param {MouseEvent|PointerEvent} e
* @returns {LatLng}
*/
pointerEventToLatLng(e: MouseEvent | PointerEvent): LatLng;
/**
* Fires an event of the specified type, see `Evented.fire()`. The map state change
* events caused by the user get an `originalEvent` property (see the class
* description).
* @param {string} type
* @param {object} [data]
* @param {boolean} [propagate]
* @returns {this}
*/
fire(type: string, data?: object, propagate?: boolean): this;
/**
* Runs the given function `callback` when the map gets initialized with
* a view (center and zoom) and at least one layer, or immediately
* if it's already initialized, optionally passing a function context.
* @group Other methods
* @param {(event: {target: MaplairMap}) => void} callback
* @param {object} [context]
* @returns {this}
*/
whenReady(callback: (event: {
target: MaplairMap;
}) => void, context?: object): this;
/** The options of the MaplairMap, see [the options](#maplairmapoptions). */
options: MaplairMapOptions;
}
/**
* Options of `MaplairMap`.
*/
export interface MaplairMapOptions {
/**
* The [Coordinate Reference System](#crs) to use.
* Don't change this if you're not sure what it means.
* @default EPSG3857
*/
crs?: CRS;
/**
* Initial geographic center of the map.
*/
center?: LatLngExpression;
/**
* Initial map zoom level.
*/
zoom?: number;
/**
* 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.
*/
minZoom?: number;
/**
* 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.
*/
maxZoom?: number;
/**
* Array of layers that will be added to the map initially.
* @default []
*/
layers?: Layer[];
/**
* The accessible name of the map, announced by screen
* readers, `'Map'` by default. The map container gets the ARIA role `region` with this
* label, unless it already has a role or label. The default is translated, see `I18n`.
*/
ariaLabel?: string;
/**
* 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
* [`setMaxBounds`](#map-setmaxbounds) method.
*/
maxBounds?: LatLngBoundsExpression;
/**
* The default method for drawing vector layers on the
* map. A new `SVG` renderer by default; pass `new Canvas()` to draw them on a canvas
* instead. Paths in custom panes get their own renderer for that pane, of the same
* class and with the same options as this one.
*/
renderer?: Renderer;
/**
* Whether the map zoom animation is enabled.
* @default true
*/
zoomAnimation?: boolean;
/**
* Won't animate zoom if the zoom
* difference exceeds this value (or 1 if the user prefers
* [reduced motion](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-reduced-motion)
* and `animate: true` isn't passed).
* @default 4
*/
zoomAnimationThreshold?: number;
/**
* Whether zoom animations (e.g. of the zoom
* control, double click and keyboard) change the view frame by frame through fractional
* zoom levels, like `flyTo()` and pinch zoom, instead of scaling the map with a CSS
* transition between two zoom levels. Also makes the scroll wheel zoom smoothly with
* each wheel event (see `scrollWheelZoom`), snapping to `zoomSnap` when scrolling ends.
* @default false
*/
continuousZoom?: boolean;
/**
* Whether the tile and popup fade animation is
* enabled.
* @default true
*/
fadeAnimation?: boolean;
/**
* Whether markers animate their zoom
* with the zoom animation, if disabled they will disappear for the length of the
* animation.
* @default true
*/
markerZoomAnimation?: boolean;
/**
* Whether markers far outside of the map view
* (more than half a view away) are taken off the page until the map is moved closer to
* them. This reduces the browser's rendering work, and the work of repositioning
* markers while zooming, when a map has many markers (e.g. several thousands) of which
* only some are visible at a time.
* @default false
*/
markerCulling?: boolean;
/**
* Defines the maximum size of a CSS
* translation transform (2^23). The default value should not be changed unless a web
* browser positions layers in the wrong place after doing a large `panBy`.
* @default 8388608
*/
transform3DLimit?: number;
/**
* Forces the map's zoom level to always be a multiple
* of this, particularly right after a [`fitBounds()`](#map-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 `fitBounds` or a pinch-zoom.
* @default 1
*/
zoomSnap?: number;
/**
* Controls how much the map's zoom level will change
* after a [`zoomIn()`](#map-zoomin), [`zoomOut()`](#map-zoomout), pressing `+` or `-`
* on the keyboard, or using the [zoom controls](#control-zoom). Values smaller than `1`
* (e.g. `0.5`) allow for greater granularity.
* @default 1
*/
zoomDelta?: number;
/**
* Whether the map automatically handles browser
* window resize to update itself. A hidden map (with the size 0, e.g. `display: none`
* in an inactive tab) keeps its size, view and bounds until it is shown again.
* @default true
*/
trackResize?: boolean;
}
/**
* Options of the geolocation methods of `MaplairMap`, e.g. `locate()`.
*/
export interface LocateOptions {
/**
* If `true`, starts continuous watching of location
* changes (instead of detecting it once) using W3C `watchPosition` method. You can
* later stop watching using `map.stopLocate()` method.
* @default false
*/
watch?: boolean;
/**
* If `true`, automatically sets the map view to the
* user location with respect to detection accuracy, or to world view if geolocation
* failed.
* @default false
*/
setView?: boolean;
/**
* The maximum zoom for automatic view setting
* when using `setView` option.
* @default Infinity
*/
maxZoom?: number;
/**
* Number of milliseconds to wait for a response from
* geolocation before firing a `locationerror` event.
* @default 10000
*/
timeout?: number;
/**
* Maximum age of detected location. If less than this
* amount of milliseconds passed since last geolocation response, `locate` will return
* a cached location.
* @default 0
*/
maximumAge?: number;
/**
* Enables high accuracy, see
* [description in the W3C spec](https://w3c.github.io/geolocation-api/#enablehighaccuracy-member).
* @default false
*/
enableHighAccuracy?: boolean;
}
/**
* Options of the `MaplairMap` methods which modify the zoom level.
*/
export interface ZoomOptions {
/**
* If not specified, zoom animation will happen if the
* zoom origin is inside the current view, and if the user prefers reduced motion, only
* when zooming by at most one level. If `true`, the map will attempt animating zoom
* disregarding where zoom origin is and the user's reduced motion preference. Setting
* `false` will make it always reset the view completely without animation.
*/
animate?: boolean;
}
/**
* Options of the `MaplairMap` methods which modify the center of the map.
*/
export interface PanOptions {
/**
* If `true`, panning will always be animated if possible,
* even if the user prefers reduced motion. If `false`, it will not animate panning,
* either resetting the map view if panning more than a screen away, or just setting a
* new offset for the map pane (except for `panBy` which always does the latter). If not
* specified, panning is animated, except for pans longer than half the map size when
* the user prefers reduced motion.
*/
animate?: boolean;
/**
* Duration of animated panning, in seconds.
* @default 0.25
*/
duration?: number;
/**
* The curvature factor of panning animation
* easing (third parameter of the [Cubic Bezier curve](https://cubic-bezier.com/)).
* 1.0 means linear animation, and the smaller this number, the more bowed the curve.
* @default 0.25
*/
easeLinearity?: number;
/**
* If `true`, panning won't fire `movestart`
* event on start (used internally for panning inertia).
* @default false
*/
noMoveStart?: boolean;
}
/**
* Options of the `MaplairMap` methods which modify the zoom level and the center.
*/
export interface ZoomPanOptions extends ZoomOptions, PanOptions {
/**
* Whether to animate the change: like `ZoomOptions.animate`
* if the zoom level changes, and like `PanOptions.animate` otherwise. The `zoom` and
* `pan` options can set it for each case separately.
*/
animate?: boolean;
/**
* If `true`, the view is reset without animation.
*/
reset?: boolean;
/**
* Options for the zoom part of the change, taking
* precedence over `animate`.
*/
zoom?: ZoomOptions;
/**
* Options for the pan part of the change, taking
* precedence over `animate`.
*/
pan?: PanOptions;
}
/**
* Options of `MaplairMap.invalidateSize()`.
*/
export interface InvalidateSizeOptions extends PanOptions {
/**
* If `true`, the map pans to its new center with
* animation.
* @default false
*/
animate?: boolean;
/**
* If `false`, panning will not occur.
* @default true
*/
pan?: boolean;
/**
* If `true`, it will delay `moveend` event
* so that it doesn't happen often even if the method is called many times in a row.
* @default false
*/
debounceMoveend?: boolean;
}
/**
* Padding options of `MaplairMap` methods, e.g. `panInside()`.
*/
export interface PaddingOptions {
/**
* Sets the amount of padding in the
* top left corner of a map container that shouldn't be accounted for when setting the
* view to fit bounds. Useful if you have some control overlays on the map like a
* sidebar and you don't want them to obscure objects you're zooming to.
* @default [0, 0]
*/
paddingTopLeft?: PointExpression;
/**
* The same for the bottom right
* corner of the map.
* @default [0, 0]
*/
paddingBottomRight?: PointExpression;
/**
* Equivalent of setting both top left and
* bottom right padding to the same value.
* @default [0, 0]
*/
padding?: PointExpression;
}
/**
* Options of `MaplairMap.fitBounds()` and similar methods.
*/
export interface FitBoundsOptions extends ZoomPanOptions, PaddingOptions {
/**
* The maximum possible zoom to use.
* @default null
*/
maxZoom?: number|null;
/**
* Added to the zoom that fits the bounds (within
* `maxZoom`), e.g. `-1` to zoom out one level more, leaving room around the bounds.
* @default 0
*/
zoomOffset?: number;
}
import { Evented } from '../core/Events.js';
import type { LatLngExpression } from '../geo/LatLng.js';
import { Point } from '../geometry/Point.js';
import type { LatLngBoundsExpression } from '../geo/LatLngBounds.js';
import type { PointExpression } from '../geometry/Point.js';
import { PosAnimation } from '../dom/PosAnimation.js';
import type { CRS } from '../geo/crs/CRS.js';
import type { Handler } from '../core/Handler.js';
import { LatLng } from '../geo/LatLng.js';
import { LatLngBounds } from '../geo/LatLngBounds.js';
import { Bounds } from '../geometry/Bounds.js';
import { EPSG3857 } from '../geo/crs/EPSG3857.js';
import { Layer } from '../layer/Layer.js';
import type { Renderer } from '../layer/vector/Renderer.js';
export { MaplairMap as Map, MaplairMap as LeafletMap };