diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index efe8f8ebf..1708a9d10 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -3,7 +3,7 @@ // Definitions by: Vladimir Zotov // Definitions: https://github.com/borisyankov/DefinitelyTyped - + declare module L { export interface AttributionOptions { @@ -13,16 +13,16 @@ declare module L { * Default value: 'bottomright'. */ position?: string; - + /** * The HTML text shown before the attributions. Pass false to disable. * Default value: 'Powered by Leaflet'. */ prefix?: string; - + } } - + declare module L { /** @@ -56,49 +56,49 @@ declare module L { * Extends the bounds to contain the given point. */ extend(point: Point): void; - + /** * Returns the center point of the bounds. */ getCenter(): Point; - + /** * Returns true if the rectangle contains the given one. */ contains(otherBounds: Bounds): boolean; - + /** * Returns true if the rectangle contains the given point. */ contains(point: Point): boolean; - + /** * Returns true if the rectangle intersects the given bounds. */ intersects(otherBounds: Bounds): boolean; - + /** * Returns true if the bounds are properly initialized. */ isValid(): boolean; - + /** * Returns the size of the given bounds. */ getSize(): Point; - + /** * The top left corner of the rectangle. */ min: Point; - + /** * The bottom right corner of the rectangle. */ max: Point; } } - + declare module L { module Browser { @@ -107,73 +107,73 @@ declare module L { * true for all Internet Explorer versions. */ export var ie: boolean; - + /** * true for Internet Explorer 6. */ export var ie6: boolean; - + /** * true for Internet Explorer 6. */ export var ie7: boolean; - + /** * true for webkit-based browsers like Chrome and Safari (including mobile * versions). */ export var webkit: boolean; - + /** * true for webkit-based browsers that support CSS 3D transformations. */ export var webkit3d: boolean; - + /** * true for Android mobile browser. */ export var android: boolean; - + /** * true for old Android stock browsers (2 and 3). */ export var android23: boolean; - + /** * true for modern mobile browsers (including iOS Safari and different Android * browsers). */ export var mobile: boolean; - + /** * true for mobile webkit-based browsers. */ export var mobileWebkit: boolean; - + /** * true for mobile Opera. */ export var mobileOpera: boolean; - + /** * true for all browsers on touch devices. */ export var touch: boolean; - + /** * true for browsers with Microsoft touch model (e.g. IE10). */ export var msTouch: boolean; - + /** * true for devices with Retina screens. */ export var retina: boolean; - + } } - - + + declare module L { /** @@ -196,17 +196,17 @@ declare module L { * Returns the current geographical position of the circle. */ getLatLng(): LatLng; - + /** * Returns the current radius of a circle. Units are in meters. */ getRadius(): number; - + /** * Sets the position of a circle to a new location. */ setLatLng(latlng: LatLng): Circle; - + /** * Sets the radius of a circle. Units are in meters. */ @@ -219,7 +219,7 @@ declare module L { } } - + declare module L { /** @@ -245,7 +245,7 @@ declare module L { * Sets the position of a circle marker to a new location. */ setLatLng(latlng: LatLng): CircleMarker; - + /** * Sets the radius of a circle marker. Units are in pixels. */ @@ -261,24 +261,24 @@ declare module L { declare module L { export interface ClassExtendOptions { /** - * options is a special property that unlike other objects that you pass - * to extend will be merged with the parent one instead of overriding it - * completely, which makes managing configuration of objects and default + * options is a special property that unlike other objects that you pass + * to extend will be merged with the parent one instead of overriding it + * completely, which makes managing configuration of objects and default * values convenient. */ options?: any; /** - * includes is a special class property that merges all specified objects + * includes is a special class property that merges all specified objects * into the class (such objects are called mixins). A good example of this - * is L.Mixin.Events that event-related methods like on, off and fire + * is L.Mixin.Events that event-related methods like on, off and fire * to the class. */ includes?: any; /** - * statics is just a convenience property that injects specified object - * properties as the static properties of the class, useful for defining + * statics is just a convenience property that injects specified object + * properties as the static properties of the class, useful for defining * constants. */ static?: any; @@ -491,7 +491,7 @@ declare module L { export function scale(options?: ScaleOptions): L.Control.Scale; } } - + declare module L { export interface ControlOptions { @@ -505,7 +505,7 @@ declare module L { } } - + declare module L { module CRS { @@ -516,28 +516,28 @@ declare module L { * Map's crs option. */ export var EPSG3857: ICRS; - + /** * A common CRS among GIS enthusiasts. Uses simple Equirectangular projection. */ export var EPSG4326: ICRS; - + /** * Rarely used by some commercial tile providers. Uses Elliptical Mercator * projection. */ export var EPSG3395: ICRS; - + /** * A simple CRS that maps longitude and latitude into x and y directly. May be * used for maps of flat surfaces (e.g. game maps). Note that the y axis should * still be inverted (going from bottom to top). */ export var Simple: ICRS; - + } } - + declare module L { /** @@ -556,7 +556,7 @@ declare module L { export interface DivIcon extends Icon { } } - + declare module L { export interface DivIconOptions { @@ -565,7 +565,7 @@ declare module L { * Size of the icon in pixels. Can be also set through CSS. */ iconSize?: Point; - + /** * The coordinates of the "tip" of the icon (relative to its top left corner). * The icon will be aligned so that this point is at the marker's geographical @@ -573,24 +573,24 @@ declare module L { * with negative margins. */ iconAnchor?: Point; - + /** * A custom class name to assign to the icon. * * Default value: 'leaflet-div-icon'. */ className?: string; - + /** * A custom HTML code to put inside the div element. * * Default value: ''. */ html?: string; - + } } - + declare module L { export interface DomEvent { @@ -601,13 +601,13 @@ declare module L { */ addListener(el: HTMLElement, type: string, fn: (e: Event) => void, context?: any): DomEvent; on(el: HTMLElement, type: string, fn: (e: Event) => void, context?: any): DomEvent; - + /** * Removes an event listener from the element. */ removeListener(el: HTMLElement, type: string, fn: (e: Event) => void, context?: any): DomEvent; off(el: HTMLElement, type: string, fn: (e: Event) => void, context?: any): DomEvent; - + /** * Stop the given event from propagation to parent elements. Used inside the * listener functions: @@ -617,41 +617,41 @@ declare module L { * }); */ stopPropagation(e: Event): DomEvent; - + /** * Prevents the default action of the event from happening (such as following * a link in the href of the a element, or doing a POST request with page reload * when form is submitted). Use it inside listener functions. */ preventDefault(e: Event): DomEvent; - + /** * Does stopPropagation and preventDefault at the same time. */ stop(e: Event): DomEvent; - + /** * Adds stopPropagation to the element's 'click', 'doubleclick', 'mousedown' * and 'touchstart' events. */ disableClickPropagation(el: HTMLElement): DomEvent; - + /** * Gets normalized mouse position from a DOM event relative to the container * or to the whole page if not specified. */ getMousePosition(e: Event, container?: HTMLElement): Point; - + /** * Gets normalized wheel delta from a mousewheel DOM event. */ getWheelDelta(e: Event): number; - + } export var DomEvent: DomEvent; } - + declare module L { module DomUtil { @@ -661,74 +661,74 @@ declare module L { * the element if it was passed directly. */ export function get(id: string): HTMLElement; - + /** * Returns the value for a certain style attribute on an element, including * computed values or values set through CSS. */ export function getStyle(el: HTMLElement, style: string): string; - + /** * Returns the offset to the viewport for the requested element. */ export function getViewportOffset(el: HTMLElement): Point; - + /** * Creates an element with tagName, sets the className, and optionally appends * it to container element. */ export function create(tagName: string, className: string, container?: HTMLElement): HTMLElement; - + /** * Makes sure text cannot be selected, for example during dragging. */ export function disableTextSelection(): void; - + /** * Makes text selection possible again. */ export function enableTextSelection(): void; - + /** * Returns true if the element class attribute contains name. */ export function hasClass(el: HTMLElement, name: string): boolean; - + /** * Adds name to the element's class attribute. */ export function addClass(el: HTMLElement, name: string): void; - + /** * Removes name from the element's class attribute. */ export function removeClass(el: HTMLElement, name: string): void; - + /** * Set the opacity of an element (including old IE support). Value must be from * 0 to 1. */ export function setOpacity(el: HTMLElement, value: number): void; - + /** * Goes through the array of style names and returns the first name that is a valid * style name for an element. If no such name is found, it returns false. Useful * for vendor-prefixed styles like transform. */ export function testProp(props: string[]): any; - + /** * Returns a CSS transform string to move an element by the offset provided in * the given point. Uses 3D translate on WebKit for hardware-accelerated transforms * and 2D on other browsers. */ export function getTranslateString(point: Point): string; - + /** * Returns a CSS transform string to scale an element (with the given scale origin). */ export function getScaleString(scale: number, origin: Point): string; - + /** * Sets the position of an element to coordinates specified by point, using * CSS translate or top/left positioning depending on the browser (used by @@ -736,25 +736,25 @@ declare module L { * if disable3D is true. */ export function setPosition(el: HTMLElement, point: Point, disable3D?: boolean): void; - + /** * Returns the coordinates of an element previously positioned with setPosition. */ export function getPosition(el: HTMLElement): Point; - + /** * Vendor-prefixed transition style name (e.g. 'webkitTransition' for WebKit). */ export var TRANSITION: string; - + /** * Vendor-prefixed transform style name. */ export var TRANSFORM: string; - + } } - + declare module L { /** @@ -778,12 +778,12 @@ declare module L { * Enables the dragging ability. */ enable(): void; - + /** * Disables the dragging ability. */ disable(): void; - + //////////////// //////////////// addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): Draggable; @@ -801,10 +801,10 @@ declare module L { on(eventMap: any, context?: any): Draggable; off(eventMap?: any, context?: any): Draggable; } -} - - - +} + + + declare module L { /** @@ -827,23 +827,23 @@ declare module L { * group that has a bindPopup method. */ bindPopup(htmlContent: string, options?: PopupOptions): FeatureGroup; - + /** * Returns the LatLngBounds of the Feature Group (created from bounds and coordinates * of its children). */ getBounds(): LatLngBounds; - + /** * Sets the given path options to each layer of the group that has a setStyle method. */ setStyle(style: PathOptions): FeatureGroup; - + /** * Brings the layer group to the top of all other layers. */ bringToFront(): FeatureGroup; - + /** * Brings the layer group to the bottom of all other layers. */ @@ -857,13 +857,13 @@ declare module L { * Called on map.addLayer(layer). */ onAdd(map: Map): void; - + /** * Should contain all clean up code that removes the overlay's elements from * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer). */ onRemove(map: Map): void; - + //////////////// //////////////// addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): FeatureGroup; @@ -882,7 +882,7 @@ declare module L { off(eventMap?: any, context?: any): FeatureGroup; } } - + declare module L { export interface FitBoundsOptions extends ZoomPanOptions { @@ -899,14 +899,14 @@ declare module L { /** * The same for bottom right corner of the map. - * + * * Default value: [0, 0]. */ paddingBottomRight?: Point; /** * Equivalent of setting both top left and bottom right padding to the same value. - * + * * Default value: [0, 0]. */ padding?: Point; @@ -919,7 +919,7 @@ declare module L { maxZoom?: number; } } - + declare module L { /** @@ -961,20 +961,20 @@ declare module L { export interface GeoJSON extends FeatureGroup { /** - * Adds a GeoJSON object to the layer. + * Adds a GeoJSON object to the layer. */ addData(data: any): boolean; - + /** * Changes styles of GeoJSON vector layers with the given style function. */ setStyle(style: (featureData: any) => any): GeoJSON; - + /** * Changes styles of GeoJSON vector layers with the given style options. */ setStyle(style: PathOptions): GeoJSON; - + /** * Resets the the given vector layer's style to the original GeoJSON style, * useful for resetting style after hover events. @@ -1017,9 +1017,9 @@ declare module L { } } - - - + + + declare module L { /** @@ -1056,7 +1056,7 @@ declare module L { } } } - + declare module L { export interface IconOptions { @@ -1066,18 +1066,18 @@ declare module L { * path). */ iconUrl?: string; - + /** * The URL to a retina sized version of the icon image (absolute or relative to * your script path). Used for Retina screen devices. */ iconRetinaUrl?: string; - + /** * Size of the icon image in pixels. */ iconSize?: Point; - + /** * The coordinates of the "tip" of the icon (relative to its top left corner). * The icon will be aligned so that this point is at the marker's geographical @@ -1085,43 +1085,43 @@ declare module L { * with negative margins. */ iconAnchor?: Point; - + /** * The URL to the icon shadow image. If not specified, no shadow image will be * created. */ shadowUrl?: string; - + /** * The URL to the retina sized version of the icon shadow image. If not specified, * no shadow image will be created. Used for Retina screen devices. */ shadowRetinaUrl?: string; - + /** * Size of the shadow image in pixels. */ shadowSize?: Point; - + /** * The coordinates of the "tip" of the shadow (relative to its top left corner) * (the same as iconAnchor if not specified). */ shadowAnchor?: Point; - + /** * The coordinates of the point from which popups will "open", relative to the * icon anchor. */ popupAnchor?: Point; - + /** * A custom class name to assign to both icon and shadow images. Empty by default. */ className?: string; } } - + declare module L { export interface IControl { @@ -1132,7 +1132,7 @@ declare module L { * containing the control. Called on map.addControl(control) or control.addTo(map). */ onAdd(map: Map): HTMLElement; - + /** * Optional, should contain all clean up code (e.g. removes control's event * listeners). Called on map.removeControl(control) or control.removeFrom(map). @@ -1141,7 +1141,7 @@ declare module L { onRemove(map: Map): void; } } - + declare module L { export interface ICRS { @@ -1150,35 +1150,35 @@ declare module L { * Projection that this CRS uses. */ projection: IProjection; - + /** * Transformation that this CRS uses to turn projected coordinates into screen * coordinates for a particular tile service. */ transformation: Transformation; - + /** * Standard code name of the CRS passed into WMS services (e.g. 'EPSG:3857'). */ code: string; - + /** * Projects geographical coordinates on a given zoom into pixel coordinates. */ latLngToPoint(latlng: LatLng, zoom: number): Point; - + /** * The inverse of latLngToPoint. Projects pixel coordinates on a given zoom * into geographical coordinates. */ pointToLatLng(point: Point, zoom: number): LatLng; - + /** * Projects geographical coordinates into coordinates in units accepted * for this CRS (e.g. meters for EPSG:3857, for passing it to WMS services). */ project(latlng: LatLng): Point; - + /** * Returns the scale used when transforming projected coordinates into pixel * coordinates for a particular zoom. For example, it returns 256 * 2^zoom for @@ -1190,10 +1190,10 @@ declare module L { * Returns the size of the world in pixels for a particular zoom. */ getSize(zoom: number): Point; - + } } - + declare module L { export interface IEventPowered { @@ -1205,7 +1205,7 @@ declare module L { * dblclick'). */ addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): T; - + /** * The same as above except the listener will only get fired once and then removed. */ @@ -1214,29 +1214,29 @@ declare module L { * Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove} */ addEventListener(eventMap: any, context?: any): T; - + /** * Removes a previously added listener function. If no function is specified, * it will remove all the listeners of that particular event from the object. */ removeEventListener(type: string, fn?: (e: LeafletEvent) => void, context?: any): T; - + /** * Removes a set of type/listener pairs. */ removeEventListener(eventMap?: any, context?: any): T; - + /** * Returns true if a particular event type has some listeners attached to it. */ hasEventListeners(type: string): boolean; - + /** * Fires an event of the specified type. You can optionally provide an data object * — the first argument of the listener function will contain its properties. */ fireEvent(type: string, data?: any): T; - + /** * Removes all listeners to all events on the object. */ @@ -1266,14 +1266,14 @@ declare module L { * Alias to removeEventListener. */ off(eventMap?: any, context?: any): T; - + /** * Alias to fireEvent. */ fire(type: string, data?: any): T; } } - + declare module L { export interface IHandler { @@ -1282,12 +1282,12 @@ declare module L { * Enables the handler. */ enable(): void; - + /** * Disables the handler. */ disable(): void; - + /** * Returns true if the handler is enabled. */ @@ -1298,7 +1298,7 @@ declare module L { initialize(map: Map): void; } } - + declare module L { export interface ILayer { @@ -1309,7 +1309,7 @@ declare module L { * Called on map.addLayer(layer). */ onAdd(map: Map): void; - + /** * Should contain all clean up code that removes the overlay's elements from * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer). @@ -1326,7 +1326,7 @@ declare module L { export var Events: LeafletMixinEvents; } } - + declare module L { /** @@ -1349,7 +1349,7 @@ declare module L { * Adds the overlay to the map. */ addTo(map: Map): ImageOverlay; - + /** * Sets the opacity of the overlay. */ @@ -1358,13 +1358,13 @@ declare module L { /** * Changes the URL of the image. */ - setUrl(imageUrl: string): ImageOverlay; - + setUrl(imageUrl: string): ImageOverlay; + /** * Brings the layer to the top of all overlays. */ bringToFront(): ImageOverlay; - + /** * Brings the layer to the bottom of all overlays. */ @@ -1378,7 +1378,7 @@ declare module L { * Called on map.addLayer(layer). */ onAdd(map: Map): void; - + /** * Should contain all clean up code that removes the overlay's elements from * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer). @@ -1386,7 +1386,7 @@ declare module L { onRemove(map: Map): void; } } - + declare module L { export interface ImageOverlayOptions { @@ -1397,7 +1397,7 @@ declare module L { opacity?: number; } } - + declare module L { export interface IProjection { @@ -1406,14 +1406,14 @@ declare module L { * Projects geographical coordinates into a 2D point. */ project(latlng: LatLng): Point; - + /** * The inverse of project. Projects a 2D point into geographical location. */ unproject(point: Point): LatLng; } } - + declare module L { /** @@ -1427,7 +1427,7 @@ declare module L { */ export function noConflict(): typeof L; } - + declare module L { /** * Creates an object representing a geographical point with the given latitude @@ -1483,29 +1483,29 @@ declare module L { * Haversine formula. See description on wikipedia */ distanceTo(otherLatlng: LatLng): number; - + /** * Returns true if the given LatLng point is at the same position (within a small * margin of error). */ equals(otherLatlng: LatLng): boolean; - + /** * Returns a string representation of the point (for debugging purposes). */ toString(): string; - + /** * Returns a new LatLng object with the longitude wrapped around left and right * boundaries (-180 to 180 by default). */ wrap(left: number, right: number): LatLng; - + /** * Latitude in degrees. */ lat: number; - + /** * Longitude in degrees. */ @@ -1547,7 +1547,7 @@ declare module L { * Extends the bounds to contain the given point. */ extend(latlng: LatLng): LatLngBounds; - + /** * Extends the bounds to contain the given bounds. */ @@ -1557,68 +1557,68 @@ declare module L { * Returns the south-west point of the bounds. */ getSouthWest(): LatLng; - + /** * Returns the north-east point of the bounds. */ getNorthEast(): LatLng; - + /** * Returns the north-west point of the bounds. */ getNorthWest(): LatLng; - + /** * Returns the south-east point of the bounds. */ getSouthEast(): LatLng; - + /** * Returns the center point of the bounds. */ getCenter(): LatLng; - + /** * Returns true if the rectangle contains the given one. */ contains(otherBounds: LatLngBounds): boolean; - + /** * Returns true if the rectangle contains the given point. */ contains(latlng: LatLng): boolean; - + /** * Returns true if the rectangle intersects the given bounds. */ intersects(otherBounds: LatLngBounds): boolean; - + /** * Returns true if the rectangle is equivalent (within a small margin of error) * to the given bounds. */ equals(otherBounds: LatLngBounds): boolean; - + /** * Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' * format. Useful for sending requests to web services that return geo data. */ toBBoxString(): string; - + /** * Returns bigger bounds created by extending the current bounds by a given * percentage in each direction. */ pad(bufferRatio: number): LatLngBounds; - + /** * Returns true if the bounds are properly initialized. */ isValid(): boolean; - + } } - + declare module L { /** @@ -1640,17 +1640,17 @@ declare module L { * Adds the group of layers to the map. */ addTo(map: Map): LayerGroup; - + /** * Adds a given layer to the group. */ addLayer(layer: T): LayerGroup; - + /** * Removes a given layer from the group. */ removeLayer(layer: T): LayerGroup; - + /** * Removes a given layer of the given id from the group. */ @@ -1675,7 +1675,7 @@ declare module L { * Removes all the layers from the group. */ clearLayers(): LayerGroup; - + /** * Iterates over the layers of the group, optionally specifying context of * the iterator function. @@ -1695,7 +1695,7 @@ declare module L { * Called on map.addLayer(layer). */ onAdd(map: Map): void; - + /** * Should contain all clean up code that removes the overlay's elements from * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer). @@ -1703,8 +1703,8 @@ declare module L { onRemove(map: Map): void; } } - - + + declare module L { export interface LayersOptions { @@ -1715,7 +1715,7 @@ declare module L { * Default value: 'topright'. */ position?: string; - + /** * If true, the control will be collapsed into an icon and expanded on mouse hover * or touch. @@ -1723,7 +1723,7 @@ declare module L { * Default value: true. */ collapsed?: boolean; - + /** * If true, the control will assign zIndexes in increasing order to all of its * layers so that the order is preserved when switching them on/off. @@ -1731,10 +1731,10 @@ declare module L { * Default value: true. */ autoZIndex?: boolean; - + } } - + declare module L { export interface LeafletErrorEvent extends LeafletEvent { @@ -1743,14 +1743,14 @@ declare module L { * Error message. */ message: string; - + /** * Error code (if applicable). */ code: number; } } - + declare module L { export interface LeafletEvent { @@ -1766,7 +1766,7 @@ declare module L { target: any; } } - + declare module L { export interface LeafletGeoJSONEvent extends LeafletEvent { @@ -1775,24 +1775,24 @@ declare module L { * The layer for the GeoJSON feature that is being added to the map. */ layer: ILayer; - + /** * GeoJSON properties of the feature. */ properties: any; - + /** * GeoJSON geometry type of the feature. */ geometryType: string; - + /** * GeoJSON ID of the feature (if present). */ id: string; } } - + declare module L { export interface LeafletLayerEvent extends LeafletEvent { @@ -1803,7 +1803,7 @@ declare module L { layer: ILayer; } } - + declare module L { export interface LeafletLocationEvent extends LeafletEvent { @@ -1812,13 +1812,13 @@ declare module L { * Detected geographical location of the user. */ latlng: LatLng; - + /** * Geographical bounds of the area user is located in (with respect to the accuracy * of location). */ bounds: LatLngBounds; - + /** * Accuracy of location in meters. */ @@ -1848,10 +1848,10 @@ declare module L { * The time when the position was acquired. */ timestamp: number; - + } } - + declare module L { export interface LeafletMouseEvent extends LeafletEvent { @@ -1860,26 +1860,26 @@ declare module L { * The geographical point where the mouse event occured. */ latlng: LatLng; - + /** * Pixel coordinates of the point where the mouse event occured relative to * the map layer. */ layerPoint: Point; - + /** * Pixel coordinates of the point where the mouse event occured relative to * the map сontainer. */ containerPoint: Point; - + /** * The original DOM mouse event fired by the browser. */ originalEvent: MouseEvent; } } - + declare module L { export interface LeafletPopupEvent extends LeafletEvent { @@ -1901,7 +1901,7 @@ declare module L { distance: number; } } - + declare module L { export interface LeafletResizeEvent extends LeafletEvent { @@ -1910,14 +1910,14 @@ declare module L { * The old size before resize event. */ oldSize: Point; - + /** * The new size after the resize event. */ newSize: Point; } } - + declare module L { export interface LeafletTileEvent extends LeafletEvent { @@ -1926,14 +1926,14 @@ declare module L { * The tile element (image). */ tile: HTMLElement; - + /** * The source URL of the tile. */ url: string; } } - + declare module L { module LineUtil { @@ -1947,27 +1947,27 @@ declare module L { * released as a separated micro-library Simplify.js. */ export function simplify(points: Point[], tolerance: number): Point[]; - + /** * Returns the distance between point p and segment p1 to p2. */ export function pointToSegmentDistance(p: Point, p1: Point, p2: Point): number; - + /** * Returns the closest point from a point p on a segment p1 to p2. */ export function closestPointOnSegment(p: Point, p1: Point, p2: Point): number; - + /** * Clips the segment a to b by rectangular bounds (modifying the segment points * directly!). Used by Leaflet to only show polyline points that are on the screen * or near, increasing performance. */ export function clipSegment(a: Point, b: Point, bounds: Bounds): void; - + } } - + declare module L { export interface LocateOptions { @@ -1980,7 +1980,7 @@ declare module L { * Default value: 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. @@ -1988,14 +1988,14 @@ declare module L { * Default value: false. */ setView?: boolean; - + /** * The maximum zoom for automatic view setting when using `setView` option. * * Default value: Infinity. */ maxZoom?: number; - + /** * Number of millisecond to wait for a response from geolocation before firing * a locationerror event. @@ -2003,7 +2003,7 @@ declare module L { * Default value: 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. @@ -2011,7 +2011,7 @@ declare module L { * Default value: 0. */ maximumAge?: number; - + /** * Enables high accuracy, see description in the W3C spec. * @@ -2020,7 +2020,7 @@ declare module L { enableHighAccuracy?: boolean; } } - + declare module L { /** @@ -2063,17 +2063,17 @@ declare module L { * animation options. */ setView(center: LatLng, zoom?: number, options?: ZoomPanOptions): Map; - + /** * Sets the zoom of the map. */ setZoom(zoom: number, options?: ZoomOptions): Map; - + /** * Increases the zoom of the map by delta (1 by default). */ zoomIn(delta?: number, options?: ZoomOptions): Map; - + /** * Decreases the zoom of the map by delta (1 by default). */ @@ -2084,43 +2084,43 @@ declare module L { * (e.g. used internally for scroll zoom and double-click zoom). */ setZoomAround(latlng: LatLng, zoom: number, options?: ZoomOptions): Map; - + /** * Sets a map view that contains the given geographical bounds with the maximum * zoom level possible. */ fitBounds(bounds: LatLngBounds, options?: FitBoundsOptions): Map; - + /** * Sets a map view that mostly contains the whole world with the maximum zoom * level possible. */ fitWorld(options?: FitBoundsOptions): Map; - + /** * Pans the map to a given center. Makes an animated pan if new center is not more * than one screen away from the current one. */ panTo(latlng: LatLng, options?: PanOptions): Map; - + /** * Pans the map to the closest view that would lie inside the given bounds (if * it's not already). */ panInsideBounds(bounds: LatLngBounds): Map; - + /** * Pans the map by a given number of pixels (animated). */ panBy(point: Point, options?: PanOptions): Map; - + /** * Checks if the map container size changed and updates the map if so — call it * after you've changed the map size dynamically, also animating pan by default. * If options.pan is false, panning will not occur. */ invalidateSize(options: ZoomPanOptions): Map; - + /** * Checks if the map container size changed and updates the map if so — call it * after you've changed the map size dynamically, also animating pan by default. @@ -2132,7 +2132,7 @@ declare module L { * passing the given animation options through to `setView`, if required. */ setMaxBounds(bounds: LatLngBounds, options?: ZoomPanOptions): Map; - + /** * Tries to locate the user using Geolocation API, firing locationfound event * with location data on success or locationerror event on failure, and optionally @@ -2141,7 +2141,7 @@ declare module L { * details. */ locate(options?: LocateOptions): Map; - + /** * Stops watching location previously initiated by map.locate({watch: true}) * and aborts resetting the map view if map.locate was called with {setView: true}. @@ -2152,34 +2152,34 @@ declare module L { * Destroys the map and clears all related event listeners. */ remove(): Map; - + // Methods for Getting Map State /** * Returns the geographical center of the map view. */ getCenter(): LatLng; - + /** * Returns the current zoom of the map view. */ getZoom(): number; - + /** * Returns the minimum zoom level of the map. */ getMinZoom(): number; - + /** * Returns the maximum zoom level of the map. */ getMaxZoom(): number; - + /** * Returns the LatLngBounds of the current map view. */ getBounds(): LatLngBounds; - + /** * 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 @@ -2187,24 +2187,24 @@ declare module L { * entirety. */ getBoundsZoom(bounds: LatLngBounds, inside?: boolean): number; - + /** * Returns the current size of the map container. */ getSize(): Point; - + /** * Returns the bounds of the current map view in projected pixel coordinates * (sometimes useful in layer and overlay implementations). */ getPixelBounds(): Bounds; - + /** * Returns the projected pixel coordinates of the top left point of the map layer * (useful in custom layer and overlay implementations). */ getPixelOrigin(): Point; - + // Methods for Layers and Controls /** @@ -2212,31 +2212,31 @@ declare module L { * the layer is inserted under all others (useful when switching base tile layers). */ addLayer(layer: ILayer, insertAtTheBottom?: boolean): Map; - + /** * Removes the given layer from the map. */ removeLayer(layer: ILayer): Map; - + /** * Returns true if the given layer is currently added to the map. */ hasLayer(layer: ILayer): boolean; - + /** * Opens the specified popup while closing the previously opened (to make sure * only one is opened at one time for usability). */ openPopup(popup: Popup): Map; - + /** - * Creates a popup with the specified options and opens it in the given point + * Creates a popup with the specified options and opens it in the given point * on a map. */ openPopup(html: string, latlng: LatLng, options?: PopupOptions): Map; - + /** - * Creates a popup with the specified options and opens it in the given point + * Creates a popup with the specified options and opens it in the given point * on a map. */ openPopup(el: HTMLElement, latlng: LatLng, options?: PopupOptions): Map; @@ -2245,17 +2245,17 @@ declare module L { * Closes the popup previously opened with openPopup (or the given one). */ closePopup(popup?: Popup): Map; - + /** * Adds the given control to the map. */ addControl(control: IControl): Map; - + /** * Removes the given control from the map. */ removeControl(control: IControl): Map; - + // Conversion Methods /** @@ -2263,116 +2263,116 @@ declare module L { * (useful for placing overlays on the map). */ latLngToLayerPoint(latlng: LatLng): Point; - + /** * Returns the geographical coordinates of a given map layer point. */ layerPointToLatLng(point: Point): LatLng; - + /** * Converts the point relative to the map container to a point relative to the * map layer. */ containerPointToLayerPoint(point: Point): Point; - + /** * Converts the point relative to the map layer to a point relative to the map * container. */ layerPointToContainerPoint(point: Point): Point; - + /** * Returns the map container point that corresponds to the given geographical * coordinates. */ latLngToContainerPoint(latlng: LatLng): Point; - + /** * Returns the geographical coordinates of a given map container point. */ containerPointToLatLng(point: Point): LatLng; - + /** * Projects the given geographical coordinates to absolute pixel coordinates * for the given zoom level (current zoom level by default). */ project(latlng: LatLng, zoom?: number): Point; - + /** * Projects the given absolute pixel coordinates to geographical coordinates * for the given zoom level (current zoom level by default). */ unproject(point: Point, zoom?: number): LatLng; - + /** * Returns the pixel coordinates of a mouse click (relative to the top left corner * of the map) given its event object. */ mouseEventToContainerPoint(event: LeafletMouseEvent): Point; - + /** * Returns the pixel coordinates of a mouse click relative to the map layer given * its event object. */ mouseEventToLayerPoint(event: LeafletMouseEvent): Point; - + /** * Returns the geographical coordinates of the point the mouse clicked on given * the click's event object. */ mouseEventToLatLng(event: LeafletMouseEvent): LatLng; - + // Other Methods /** * Returns the container element of the map. */ getContainer(): HTMLElement; - + /** * Returns an object with different map panes (to render overlays in). */ getPanes(): MapPanes; - + // REVIEW: Should we make it more flexible declaring parameter 'fn' as Function? /** * Runs the given callback when the map gets initialized with a place and zoom, * or immediately if it happened already, optionally passing a function context. */ whenReady(fn: (map: Map) => void, context?: any): Map; - + // Properties /** * Map dragging handler (by both mouse and touch). */ dragging: IHandler; - + /** * Touch zoom handler. */ touchZoom: IHandler; - + /** * Double click zoom handler. */ doubleClickZoom: IHandler; - + /** * Scroll wheel zoom handler. */ scrollWheelZoom: IHandler; - + /** * Box (shift-drag with mouse) zoom handler. */ boxZoom: IHandler; - + /** * Keyboard navigation handler. */ keyboard: IHandler; - + /** * Mobile touch hacks (quick tap and touch hold) handler. */ @@ -2421,27 +2421,27 @@ declare module L { * Initial geographical center of the map. */ center?: LatLng; - + /** * Initial map zoom. */ zoom?: number; - + /** * Layers that will be added to the map initially. */ layers?: ILayer[]; - + /** * Minimum zoom level of the map. Overrides any minZoom set on map layers. */ minZoom?: number; - + /** * Maximum zoom level of the map. This overrides any maxZoom set on map layers. */ maxZoom?: number; - + /** * 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 @@ -2449,7 +2449,7 @@ declare module L { * on the map size). To set the restriction dynamically, use setMaxBounds method */ maxBounds?: LatLngBounds; - + /** * Coordinate Reference System to use. Don't change this if you're not sure * what it means. @@ -2457,7 +2457,7 @@ declare module L { * Default value: L.CRS.EPSG3857. */ crs?: ICRS; - + // Interaction Options /** @@ -2466,14 +2466,14 @@ declare module L { * Default value: true. */ dragging?: boolean; - + /** * Whether the map can be zoomed by touch-dragging with two fingers. * * Default value: true. */ touchZoom?: 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 @@ -2482,7 +2482,7 @@ declare module L { * Default value: true. */ scrollWheelZoom?: boolean; - + /** * Whether the map can be zoomed in by double clicking on it and zoomed out * by double clicking while holding shift. @@ -2523,7 +2523,7 @@ declare module L { * Default value: true. */ trackResize?: 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 @@ -2532,14 +2532,14 @@ declare module L { * Default value: false. */ worldCopyJump?: boolean; - + /** * Set it to false if you don't want popups to close when user clicks the map. * * Default value: true. */ closePopupOnClick?: boolean; - + // Keyboard Navigation Options /** @@ -2549,21 +2549,21 @@ declare module L { * Default value: true. */ keyboard?: boolean; - + /** * Amount of pixels to pan when pressing an arrow key. * * Default value: 80. */ keyboardPanOffset?: number; - + /** * Number of zoom levels to change when pressing + or - key. * * Default value: 1. */ keyboardZoomOffset?: number; - + // Panning Inertia Options /** @@ -2574,21 +2574,21 @@ declare module L { * Default value: true. */ inertia?: boolean; - + /** * The rate with which the inertial movement slows down, in pixels/second2. * * Default value: 3000. */ inertiaDeceleration?: number; - + /** * Max speed of the inertial movement, in pixels/second. * * Default value: 1500. */ inertiaMaxSpeed?: number; - + /** * Amount of milliseconds that should pass between stopping the movement and * releasing the mouse or touch to prevent inertial movement. @@ -2596,7 +2596,7 @@ declare module L { * Default value: 32 for touch devices and 14 for the rest. */ inertiaThreshold?: number; - + // Control options /** @@ -2605,14 +2605,14 @@ declare module L { * Default value: true. */ zoomControl?: boolean; - + /** * Whether the attribution control is added to the map by default. * * Default value: true. */ attributionControl?: boolean; - + // Animation options /** @@ -2620,7 +2620,7 @@ declare module L { * browsers that support CSS3 Transitions except Android. */ fadeAnimation?: boolean; - + /** * Whether the tile zoom animation is enabled. By default it's enabled in all * browsers that support CSS3 Transitions except Android. @@ -2650,7 +2650,7 @@ declare module L { bounceAtZoomLimits?: boolean; } } - + declare module L { export interface MapPanes { @@ -2691,7 +2691,7 @@ declare module L { popupPane: HTMLElement; } } - + declare module L { /** @@ -2713,44 +2713,44 @@ declare module L { * Adds the marker to the map. */ addTo(map: Map): Marker; - + /** * Returns the current geographical position of the marker. */ getLatLng(): LatLng; - + /** * Changes the marker position to the given point. */ setLatLng(latlng: LatLng): Marker; - + /** * Changes the marker icon. */ setIcon(icon: Icon): Marker; - + /** * Changes the zIndex offset of the marker. */ setZIndexOffset(offset: number): Marker; - + /** * Changes the opacity of the marker. */ setOpacity(opacity: number): Marker; - + /** * Updates the marker position, useful if coordinates of its latLng object * were changed directly. */ update(): Marker; - + /** * Binds a popup with a particular HTML content to a click on this marker. You * can also open the bound popup with the Marker openPopup method. */ bindPopup(html: string, options?: PopupOptions): Marker; - + /** * Binds a popup with a particular HTML content to a click on this marker. You * can also open the bound popup with the Marker openPopup method. @@ -2767,7 +2767,7 @@ declare module L { * Unbinds the popup previously bound to the marker with bindPopup. */ unbindPopup(): Marker; - + /** * Opens the popup previously bound by the bindPopup method. */ @@ -2776,8 +2776,8 @@ declare module L { /** * Returns the popup previously bound by the bindPopup method. */ - getPopup(): Popup; - + getPopup(): Popup; + /** * Closes the bound popup of the marker if it's opened. */ @@ -2816,13 +2816,13 @@ declare module L { * Called on map.addLayer(layer). */ onAdd(map: Map): void; - + /** * Should contain all clean up code that removes the overlay's elements from * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer). */ onRemove(map: Map): void; - + //////////////// //////////////// addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): Marker; @@ -2841,7 +2841,7 @@ declare module L { off(eventMap?: any, context?: any): Marker; } } - + declare module L { export interface MarkerOptions { @@ -2853,7 +2853,7 @@ declare module L { * Default value: new L.Icon.Default(). */ icon?: Icon; - + /** * If false, the marker will not emit mouse events and will act as a part of the * underlying map. @@ -2861,7 +2861,7 @@ declare module L { * Default value: true. */ clickable?: boolean; - + /** * Whether the marker is draggable with mouse/touch or not. * @@ -2875,7 +2875,7 @@ declare module L { * Default value: true. */ keyboard?: boolean; - + /** * Text for the browser tooltip that appear on marker hover (no tooltip by default). * @@ -2889,7 +2889,7 @@ declare module L { * Default value: ''. */ alt?: string; - + /** * By default, marker images zIndex is set automatically based on its latitude. * You this option if you want to put the marker on top of all others (or below), @@ -2898,21 +2898,21 @@ declare module L { * Default value: 0. */ zIndexOffset?: number; - + /** * The opacity of the marker. * * Default value: 1.0. */ opacity?: number; - + /** * If true, the marker will get on top of others when you hover the mouse over it. * * Default value: false. */ riseOnHover?: boolean; - + /** * The z-index offset used for the riseOnHover feature. * @@ -2921,7 +2921,7 @@ declare module L { riseOffset?: number; } } - + declare module L { /** @@ -2964,7 +2964,7 @@ declare module L { toGeoJSON(): any; } } - + declare module L { /** @@ -3005,7 +3005,7 @@ declare module L { toGeoJSON(): any; } } - + declare module L { export interface PanOptions { @@ -3013,14 +3013,14 @@ declare module L { /** * If true, panning will always be animated if possible. 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` + * away, or just setting a new offset for the map pane (except for `panBy` * which always does the latter). */ animate?: boolean; /** * Duration of animated panning. - * + * * Default value: 0.25. */ duration?: number; @@ -3035,13 +3035,13 @@ declare module L { /** * If true, panning won't fire movestart event on start (used internally for panning inertia). - * + * * Default value: false. */ noMoveStart?: boolean; } } - + declare module L { export interface Path extends ILayer, IEventPowered { @@ -3050,12 +3050,12 @@ declare module L { * Adds the layer to the map. */ addTo(map: Map): Path; - + /** * Binds a popup with a particular HTML content to a click on this path. */ bindPopup(html: string, options?: PopupOptions): Path; - + /** * Binds a popup with a particular HTML content to a click on this path. */ @@ -3070,38 +3070,38 @@ declare module L { * Unbinds the popup previously bound to the path with bindPopup. */ unbindPopup(): Path; - + /** * Opens the popup previously bound by the bindPopup method in the given point, * or in one of the path's points if not specified. */ openPopup(latlng?: LatLng): Path; - + /** * Closes the path's bound popup if it is opened. */ closePopup(): Path; - + /** * Changes the appearance of a Path based on the options in the Path options object. */ setStyle(object: PathOptions): Path; - + /** * Returns the LatLngBounds of the path. */ getBounds(): LatLngBounds; - + /** * Brings the layer to the top of all path layers. */ bringToFront(): Path; - + /** * Brings the layer to the bottom of all path layers. */ bringToBack(): Path; - + /** * Redraws the layer. Sometimes useful after you changed the coordinates that * the path uses. @@ -3115,13 +3115,13 @@ declare module L { * Called on map.addLayer(layer). */ onAdd(map: Map): void; - + /** * Should contain all clean up code that removes the overlay's elements from * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer). */ onRemove(map: Map): void; - + //////////////// //////////////// addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): Path; @@ -3181,48 +3181,48 @@ declare module L { * Default value: true. */ stroke?: boolean; - + /** * Stroke color. * * Default value: '#03f'. */ color?: string; - + /** * Stroke width in pixels. * * Default value: 5. */ weight?: number; - + /** * Stroke opacity. * * Default value: 0.5. */ opacity?: number; - + /** * Whether to fill the path with color. Set it to false to disable filling on polygons * or circles. */ fill?: boolean; - + /** * Fill color. * * Default value: same as color. */ fillColor?: string; - + /** * Fill opacity. * * Default value: 0.2. */ fillOpacity?: number; - + /** * A string that defines the stroke dash pattern. Doesn't work on canvas-powered * layers (e.g. Android 2). @@ -3242,7 +3242,7 @@ declare module L { * Default: null. */ lineJoin?: string; - + /** * If false, the vector will not emit mouse events and will act as a part of the * underlying map. @@ -3262,10 +3262,10 @@ declare module L { * Default value: ''. */ className?: string; - + } } - + declare module L { /** @@ -3288,48 +3288,48 @@ declare module L { * Returns the result of addition of the current and the given points. */ add(otherPoint: Point): Point; - + /** * Returns the result of subtraction of the given point from the current. */ subtract(otherPoint: Point): Point; - + /** * Returns the result of multiplication of the current point by the given number. */ multiplyBy(number: number): Point; - + /** * Returns the result of division of the current point by the given number. If * optional round is set to true, returns a rounded result. */ divideBy(number: number, round?: boolean): Point; - + /** * Returns the distance between the current and the given points. */ distanceTo(otherPoint: Point): number; - + /** * Returns a copy of the current point. */ clone(): Point; - + /** * Returns a copy of the current point with rounded coordinates. */ round(): Point; - + /** * Returns true if the given point has the same coordinates. */ equals(otherPoint: Point): boolean; - + /** * Returns a string representation of the point for debugging purposes. */ toString(): string; - + /** * The x coordinate. */ @@ -3341,7 +3341,7 @@ declare module L { y: number; } } - + declare module L { /** @@ -3369,7 +3369,7 @@ declare module L { export interface Polygon extends Polyline { } } - + declare module L { /** @@ -3392,24 +3392,24 @@ declare module L { * Adds a given point to the polyline. */ addLatLng(latlng: LatLng): Polyline; - + /** * Replaces all the points in the polyline with the given array of geographical * points. */ setLatLngs(latlngs: LatLng[]): Polyline; - + /** * Returns an array of the points in the path. */ getLatLngs(): LatLng[]; - + /** * Allows adding, removing or replacing points in the polyline. Syntax is the * same as in Array#splice. Returns the array of removed points (if any). */ spliceLatLngs(index: number, pointsToRemove: number, ...latlngs: LatLng[]): LatLng[]; - + /** * Returns the LatLngBounds of the polyline. */ @@ -3421,7 +3421,7 @@ declare module L { toGeoJSON(): any; } } - + declare module L { export interface PolylineOptions { @@ -3433,7 +3433,7 @@ declare module L { * Default value: 1.0. */ smoothFactor?: number; - + /** * Disabled polyline clipping. * @@ -3442,7 +3442,7 @@ declare module L { noClip?: boolean; } } - + declare module L { module PolyUtil { @@ -3456,7 +3456,7 @@ declare module L { export function clipPolygon(points: Point[], bounds: Bounds): Point[]; } } - + declare module L { /** @@ -3481,17 +3481,17 @@ declare module L { * Adds the popup to the map. */ addTo(map: Map): Popup; - + /** * Adds the popup to the map and closes the previous one. The same as map.openPopup(popup). */ openOn(map: Map): Popup; - + /** * Sets the geographical point where the popup will open. */ setLatLng(latlng: LatLng): Popup; - + /** * Returns the geographical point of popup. */ @@ -3521,7 +3521,7 @@ declare module L { * Called on map.addLayer(layer). */ onAdd(map: Map): void; - + /** * Should contain all clean up code that removes the overlay's elements from * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer). @@ -3535,7 +3535,7 @@ declare module L { update(): Popup; } } - + declare module L { export interface PopupOptions { @@ -3546,20 +3546,20 @@ declare module L { * Default value: 300. */ maxWidth?: number; - + /** * Min width of the popup. * * Default value: 50. */ minWidth?: number; - + /** * If set, creates a scrollable container of the given height inside a popup * if its content exceeds it. */ maxHeight?: number; - + /** * Set it to false if you don't want the map to do panning animation to fit the opened * popup. @@ -3567,14 +3567,14 @@ declare module L { * Default value: true. */ autoPan?: boolean; - + /** * Controls the presense of a close button in the popup. * * Default value: true. */ closeButton?: boolean; - + /** * The offset of the popup position. Useful to control the anchor of the popup * when opening it on some overlays. @@ -3598,7 +3598,7 @@ declare module L { * Default value: null. */ autoPanPaddingBottomRight?: Point; - + /** * The margin between the popup and the edges of the map view after autopanning * was performed. @@ -3606,7 +3606,7 @@ declare module L { * Default value: new Point(5, 5). */ autoPanPadding?: Point; - + /** * Whether to animate the popup on zoom. Disable it if you have problems with * Flash content inside popups. @@ -3616,14 +3616,14 @@ declare module L { zoomAnimation?: boolean; /** - * Set it to false if you want to override the default behavior of the popup + * Set it to false if you want to override the default behavior of the popup * closing when user clicks the map (set globally by the Map closePopupOnClick * option). */ closeOnClick?: boolean; } } - + declare module L { export interface PosAnimationStatic extends ClassStatic { @@ -3641,7 +3641,7 @@ declare module L { * of the cubic bezier curve, 0.5 by default) */ run(element: HTMLElement, newPos: Point, duration?: number, easeLinearity?: number): PosAnimation; - + //////////////// //////////////// addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): PosAnimation; @@ -3660,7 +3660,7 @@ declare module L { off(eventMap?: any, context?: any): PosAnimation; } } - + declare module L { module Projection { @@ -3671,14 +3671,14 @@ declare module L { * is a sphere. Used by the EPSG:3857 CRS. */ export var SphericalMercator: IProjection; - + /** * Elliptical Mercator projection — more complex than Spherical Mercator. * Takes into account that Earth is a geoid, not a perfect sphere. Used by the * EPSG:3395 CRS. */ export var Mercator: IProjection; - + /** * Equirectangular, or Plate Carree projection — the most simple projection, * mostly used by GIS enthusiasts. Directly maps x as longitude, and y as latitude. @@ -3688,7 +3688,7 @@ declare module L { export var LonLat: IProjection; } } - + declare module L { /** @@ -3713,8 +3713,8 @@ declare module L { setBounds(bounds: LatLngBounds): Rectangle; } } - - + + declare module L { export interface ScaleOptions { @@ -3724,26 +3724,26 @@ declare module L { * Default value: 'bottomleft'. */ position?: string; - + /** * Maximum width of the control in pixels. The width is set dynamically to show * round values (e.g. 100, 200, 500). * Default value: 100. */ maxWidth?: number; - + /** * Whether to show the metric scale line (m/km). * Default value: true. */ metric?: boolean; - + /** * Whether to show the imperial scale line (mi/ft). * Default value: true. */ imperial?: boolean; - + /** * If true, the control is updated on moveend, otherwise it's always up-to-date * (updated on move). @@ -3752,7 +3752,7 @@ declare module L { updateWhenIdle?: boolean; } } - + declare module L { export interface TileLayerStatic extends ClassStatic { @@ -3784,32 +3784,32 @@ declare module L { * Adds the layer to the map. */ addTo(map: Map): TileLayer; - + /** * Brings the tile layer to the top of all tile layers. */ bringToFront(): TileLayer; - + /** * Brings the tile layer to the bottom of all tile layers. */ bringToBack(): TileLayer; - + /** * Changes the opacity of the tile layer. */ setOpacity(opacity: number): TileLayer; - + /** * Sets the zIndex of the tile layer. */ setZIndex(zIndex: number): TileLayer; - + /** * Causes the layer to clear all the tiles and request them again. */ redraw(): TileLayer; - + /** * Updates the layer's URL template and redraws it. */ @@ -3828,13 +3828,13 @@ declare module L { * Called on map.addLayer(layer). */ onAdd(map: Map): void; - + /** * Should contain all clean up code that removes the overlay's elements from * the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer). */ onRemove(map: Map): void; - + //////////////// //////////////// addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): TileLayer; @@ -3879,7 +3879,7 @@ declare module L { } export interface TileLayerFactory { - + /** * Instantiates a tile layer object given a URL template and optionally an options * object. @@ -3900,7 +3900,7 @@ declare module L { export var tileLayer: TileLayerFactory; } - + declare module L { export interface TileLayerOptions { @@ -3911,7 +3911,7 @@ declare module L { * Default value: 0. */ minZoom?: number; - + /** * Maximum zoom number. * @@ -3927,14 +3927,14 @@ declare module L { * Default value: null. */ maxNativeZoom?: number; - + /** * Tile size (width and height in pixels, assuming tiles are square). * * Default value: 256. */ tileSize?: number; - + /** * Subdomains of the tile service. Can be passed in the form of one string (where * each letter is a subdomain name) or an array of strings. @@ -3942,14 +3942,14 @@ declare module L { * Default value: 'abc'. */ subdomains?: string[]; - + /** * URL to the tile image to show in place of the tile that failed to load. * * Default value: ''. */ errorTileUrl?: string; - + /** * e.g. "© CloudMade" — the string used by the attribution control, describes * the layer data. @@ -3957,14 +3957,14 @@ declare module L { * Default value: ''. */ attribution?: string; - + /** * If true, inverses Y axis numbering for tiles (turn this on for TMS services). * * Default value: false. */ tms?: boolean; - + /** * If set to true, the tile coordinates won't be wrapped by world width (-180 * to 180 longitude) or clamped to lie within world height (-90 to 90). Use this @@ -3974,7 +3974,7 @@ declare module L { * Default value: false. */ continuousWorld?: boolean; - + /** * If set to true, the tiles just won't load outside the world width (-180 to 180 * longitude) instead of repeating. @@ -3982,14 +3982,14 @@ declare module L { * Default value: false. */ noWrap?: boolean; - + /** * The zoom number used in tile URLs will be offset with this value. * * Default value: 0. */ zoomOffset?: number; - + /** * If set to true, the zoom number used in tile URLs will be reversed (maxZoom * - zoom instead of zoom) @@ -3997,31 +3997,31 @@ declare module L { * Default value: false. */ zoomReverse?: boolean; - + /** * The opacity of the tile layer. * * Default value: 1.0. */ opacity?: number; - + /** * The explicit zIndex of the tile layer. Not set by default. */ zIndex?: number; - + /** * If true, all the tiles that are not visible after panning are removed (for * better performance). true by default on mobile WebKit, otherwise false. */ unloadInvisibleTiles?: boolean; - + /** * If false, new tiles are loaded during panning, otherwise only after it (for * better performance). true by default on mobile WebKit, otherwise false. */ updateWhenIdle?: boolean; - + /** * If true and user is on a retina display, it will request four tiles of half the * specified size and a bigger zoom level in place of one to utilize the high resolution. @@ -4029,7 +4029,7 @@ declare module L { * Default value: false. */ detectRetina?: boolean; - + /** * If true, all the tiles that are not visible after panning are placed in a reuse * queue from which they will be fetched when new tiles become visible (as opposed @@ -4058,7 +4058,7 @@ declare module L { * Only accepts real L.Point instances, not arrays. */ transform(point: Point, scale?: number): Point; - + /** * Returns the reverse transformation of the given point, optionally divided * by the given scale. Only accepts real L.Point instances, not arrays. @@ -4066,7 +4066,7 @@ declare module L { untransform(point: Point, scale?: number): Point; } } - + declare module L { module Util { @@ -4076,18 +4076,18 @@ declare module L { * and returns the latter. Has an L.extend shortcut. */ export function extend(dest: any, ...sources: any[]): any; - + /** * Returns a function which executes function fn with the given scope obj (so * that this keyword refers to obj inside the function code). Has an L.bind shortcut. */ export function bind(fn: T, obj: any): T; - + /** * Applies a unique key to the object and returns that key. Has an L.stamp shortcut. */ export function stamp(obj: any): string; - + /** * Returns a wrapper around the function fn that makes sure it's called not more * often than a certain time interval time, but as fast as possible otherwise @@ -4096,46 +4096,46 @@ declare module L { * be called. */ export function limitExecByInterval(fn: T, time: number, context?: any): T; - + /** * Returns a function which always returns false. */ export function falseFn(): () => boolean; - + /** * Returns the number num rounded to digits decimals. */ export function formatNum(num: number, digits: number): number; - + /** * Trims and splits the string on whitespace and returns the array of parts. */ export function splitWords(str: string): string[]; - + /** * Merges the given properties to the options of the obj object, returning the * resulting options. See Class options. Has an L.setOptions shortcut. */ export function setOptions(obj: any, options: any): any; - + /** * Converts an object into a parameter URL string, e.g. {a: "foo", b: "bar"} * translates to '?a=foo&b=bar'. */ export function getParamString(obj: any): string; - + /** * Simple templating facility, creates a string by applying the values of the * data object of a form {a: 'foo', b: 'bar', …} to a template string of the form * 'Hello {a}, {b}' — in this example you will get 'Hello foo, bar'. */ export function template(str: string, data: any): string; - + /** * Returns true if the given object is an array. */ export function isArray(obj: any): boolean; - + /** * Trims the whitespace from both ends of the string and returns the result. */ @@ -4149,8 +4149,8 @@ declare module L { export var emptyImageUrl: string; } } - - + + declare module L { export interface WMSOptions { @@ -4161,37 +4161,37 @@ declare module L { * Default value: ''. */ layers?: string; - + /** * Comma-separated list of WMS styles. * * Default value: 'image/jpeg'. */ styles?: string; - + /** * WMS image format (use 'image/png' for layers with transparency). * * Default value: false. */ format?: string; - + /** * If true, the WMS service will return images with transparency. * * Default value: '1.1.1'. */ transparent?: boolean; - + /** * Version of the WMS service to use. */ version?: string; - + } } - - + + declare module L { export interface ZoomOptions { @@ -4204,7 +4204,7 @@ declare module L { position?: string; } } - + declare module L { export interface ZoomPanOptions { @@ -4237,10 +4237,10 @@ declare module L { debounceMoveend?: boolean; } } - + /** - * Forces Leaflet to use the Canvas back-end (if available) for vector layers - * instead of SVG. This can increase performance considerably in some cases + * Forces Leaflet to use the Canvas back-end (if available) for vector layers + * instead of SVG. This can increase performance considerably in some cases * (e.g. many thousands of circle markers on the map). */ declare var L_PREFER_CANVAS: boolean; @@ -4251,11 +4251,11 @@ declare var L_PREFER_CANVAS: boolean; declare var L_NO_TOUCH: boolean; /** - * Forces Leaflet to not use hardware-accelerated CSS 3D transforms for positioning + * Forces Leaflet to not use hardware-accelerated CSS 3D transforms for positioning * (which may cause glitches in some rare environments) even if they're supported. */ declare var L_DISABLE_3D: boolean; - + declare module "leaflet" { export = L; }