Module L

Index

Variables

Interfaces

Classes

Functions

Variables

tileLayer: TileLayerFactory

version: string

A constant that represents the Leaflet version in use.

Functions

bounds(topLeft: Point, bottomRight: Point): Bounds

Creates a Bounds object from two coordinates (usually top-left and bottom-right corners).

Parameters

Returns

Bounds

bounds(points: Point[]): Bounds

Creates a Bounds object defined by the points it contains.

Parameters

Returns

Bounds

circle(latlng: LatLng, radius: number, options?: PathOptions): Circle

Instantiates a circle object given a geographical point, a radius in meters and optionally an options object.

Parameters

Returns

Circle

circleMarker(latlng: LatLng, options?: PathOptions): CircleMarker

Instantiates a circle marker given a geographical point and optionally an options object. The default radius is 10 and can be altered by passing a "radius" member in the path options object.

Parameters

Returns

CircleMarker

divIcon(options: DivIconOptions): DivIcon

Creates a div icon instance with the given options.

Parameters

Returns

DivIcon

draggable(element: HTMLElement, dragHandle?: HTMLElement): Draggable

Creates a Draggable object for moving the given element when you start dragging the dragHandle element (equals the element itself by default).

Parameters

  • element: HTMLElement
  • dragHandle?: HTMLElement optional

Returns

Draggable

featureGroup(layers?: Array<T extends L.ILayer>): FeatureGroup

Create a layer group, optionally given an initial set of layers.

Parameters

  • layers?: Array<T extends L.ILayer> optional

Returns

FeatureGroup

geoJson(geojson?: any, options?: GeoJSONOptions): GeoJSON

Creates a GeoJSON layer. Optionally accepts an object in GeoJSON format to display on the map (you can alternatively add it later with addData method) and an options object.

Parameters

Returns

GeoJSON

icon(options: IconOptions): Icon

Creates an icon instance with the given options.

Parameters

Returns

Icon

imageOverlay(imageUrl: string, bounds: LatLngBounds, options?: ImageOverlayOptions): ImageOverlay

Instantiates an image overlay object given the URL of the image and the geographical bounds it is tied to.

Parameters

Returns

ImageOverlay

latLng(latitude: number, longitude: number): LatLng

Creates an object representing a geographical point with the given latitude and longitude.

Parameters

  • latitude: number
  • longitude: number

Returns

LatLng

latLng(coords: Array<number>): LatLng

Creates an object representing a geographical point with the given latitude and longitude.

Parameters

  • coords: Array<number>

Returns

LatLng

latLngBounds(southWest: LatLng, northEast: LatLng): LatLngBounds

Creates a LatLngBounds object by defining south-west and north-east corners of the rectangle.

Parameters

Returns

LatLngBounds

latLngBounds(latlngs: LatLng[]): LatLngBounds

Creates a LatLngBounds object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with fitBounds.

Parameters

Returns

LatLngBounds

layerGroup(layers?: Array<T extends L.ILayer>): LayerGroup

Create a layer group, optionally given an initial set of layers.

Parameters

  • layers?: Array<T extends L.ILayer> optional

Returns

LayerGroup

map(id: HTMLElement, options?: MapOptions): Map

Instantiates a map object given a div element and optionally an object literal with map options described below.

Parameters

Returns

Map

map(id: string, options?: MapOptions): Map

Instantiates a map object given a div element id and optionally an object literal with map options described below.

Parameters

Returns

Map

marker(latlng: LatLng, options?: MarkerOptions): Marker

Instantiates a Marker object given a geographical point and optionally an options object.

Parameters

Returns

Marker

multiPolygon(latlngs: Array<L.LatLng[]>, options?: PolylineOptions): MultiPolygon

Instantiates a multi-polyline object given an array of latlngs arrays (one for each individual polygon) and optionally an options object (the same as for MultiPolyline).

Parameters

Returns

MultiPolygon

multiPolyline(latlngs: Array<L.LatLng[]>, options?: PolylineOptions): MultiPolyline

Instantiates a multi-polyline object given an array of arrays of geographical points (one for each individual polyline) and optionally an options object.

Parameters

Returns

MultiPolyline

noConflict(): L

This method restores the L global variale to the original value it had before Leaflet inclusion, and returns the real Leaflet namespace.

Returns

L

point(x: number, y: number, round?: boolean): Point

Creates a Point object with the given x and y coordinates. If optional round is set to true, rounds the x and y values.

Parameters

  • x: number
  • y: number
  • round?: boolean optional

Returns

Point

polygon(latlngs: LatLng[], options?: PolylineOptions): Polygon

Instantiates a polygon object given an array of geographical points and optionally an options object (the same as for Polyline). You can also create a polygon with holes by passing an array of arrays of latlngs, with the first latlngs array representing the exterior ring while the remaining represent the holes inside.

Parameters

Returns

Polygon

polyline(latlngs: LatLng[], options?: PolylineOptions): Polyline

Instantiates a polyline object given an array of geographical points and optionally an options object.

Parameters

Returns

Polyline

popup(options?: PopupOptions, source?: any): Popup

Instantiates a Popup object given an optional options object that describes its appearance and location and an optional object that is used to tag the popup with a reference to the source object to which it refers.

Parameters

Returns

Popup

rectangle(bounds: LatLngBounds, options?: PathOptions): Rectangle

Instantiates a rectangle object with the given geographical bounds and optionally an options object.

Parameters

Returns

Rectangle