Socket
Socket
Sign inDemoInstall

@types/leaflet

Package Overview
Dependencies
Maintainers
1
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/leaflet - npm Package Compare versions

Comparing version 1.0.50 to 1.0.51

465

leaflet/index.d.ts

@@ -1,2 +0,2 @@

// Type definitions for Leaflet.js 1.0.2
// Type definitions for Leaflet.js 1.0
// Project: https://github.com/Leaflet/Leaflet

@@ -11,2 +11,15 @@ // Definitions by: Alejandro Sánchez <https://github.com/alejo90>

// Import to avoid conflicts with the GeoJSON class of leaflet
import GeoJSONFeature = GeoJSON.Feature;
import GeoJSONLineString = GeoJSON.LineString;
import GeoJSONMultiLineString = GeoJSON.MultiLineString;
import GeoJSONPolygon = GeoJSON.Polygon;
import GeoJSONMultiPolygon = GeoJSON.MultiPolygon;
import GeoJSONFeatureCollection = GeoJSON.FeatureCollection;
import GeoJSONGeometryObject = GeoJSON.GeometryObject;
import GeoJSONGeometryCollection = GeoJSON.GeometryCollection;
import GeoJSONPoint = GeoJSON.Point;
import GeoJSONMultiPoint = GeoJSON.MultiPoint;
import GeoJSONGeoJsonObject = GeoJSON.GeoJsonObject;
declare namespace L {

@@ -29,39 +42,33 @@ export class Class {

export namespace LineUtil {
export function simplify(points: Array<Point>, tolerance: number): Array<Point>;
export function simplify(points: PointExpression[], tolerance: number): Point[];
export function simplify(points: Array<PointTuple>, tolerance: number): Array<Point>;
export function pointToSegmentDistance(p: PointExpression, p1: PointExpression, p2: PointExpression): number;
export function pointToSegmentDistance(p: Point, p1: Point, p2: Point): number;
export function pointToSegmentDistance(p: PointTuple, p1: PointTuple, p2: PointTuple): number;
export function closestPointOnSegment(p: Point, p1: Point, p2: Point): Point;
export function closestPointOnSegment(p: PointTuple, p1: PointTuple, p2: PointTuple): Point;
export function closestPointOnSegment(p: PointExpression, p1: PointExpression, p2: PointExpression): Point;
}
export namespace PolyUtil {
export function clipPolygon(points: Array<Point>, bounds: Bounds, round?: boolean): Array<Point>;
export function clipPolygon(points: Array<PointTuple>, bounds: BoundsLiteral, round?: boolean): Array<Point>;
export function clipPolygon(points: PointExpression[], bounds: BoundsExpression, round?: boolean): Point[];
}
export class DomUtil {
static get(id: string): HTMLElement;
static get(id: HTMLElement): HTMLElement;
/**
* Get Element by its ID or with the given HTML-Element
*/
static get(element: string | HTMLElement): HTMLElement;
static getStyle(el: HTMLElement, styleAttrib: string): string;
static create(tagName: String, className?: String, container?: HTMLElement): HTMLElement;
static remove(el: HTMLElement):void;
static empty(el: HTMLElement):void;
static toFront(el: HTMLElement):void;
static toBack(el: HTMLElement):void;
static hasClass(el: HTMLElement, name: String): Boolean;
static addClass(el: HTMLElement, name: String):void;
static removeClass(el: HTMLElement, name: String):void;
static setClass(el: HTMLElement, name: String):void;
static getClass(el: HTMLElement): String;
static setOpacity(el: HTMLElement, opacity: Number):void;
static testProp(props: String[]): String|boolean/*=false*/;
static setTransform(el: HTMLElement, offset: Point, scale?: Number):void;
static setPosition(el: HTMLElement, position: Point):void;
static create(tagName: string, className?: string, container?: HTMLElement): HTMLElement;
static remove(el: HTMLElement): void;
static empty(el: HTMLElement): void;
static toFront(el: HTMLElement): void;
static toBack(el: HTMLElement): void;
static hasClass(el: HTMLElement, name: string): boolean;
static addClass(el: HTMLElement, name: string): void;
static removeClass(el: HTMLElement, name: string): void;
static setClass(el: HTMLElement, name: string): void;
static getClass(el: HTMLElement): string;
static setOpacity(el: HTMLElement, opacity: number): void;
static testProp(props: string[]): string | boolean/*=false*/;
static setTransform(el: HTMLElement, offset: Point, scale?: number): void;
static setPosition(el: HTMLElement, position: Point): void;
static getPosition(el: HTMLElement): Point;

@@ -76,3 +83,3 @@ static disableTextSelection(): void;

export interface CRS {
export abstract class CRS {
latLngToPoint(latlng: LatLngExpression, zoom: number): Point;

@@ -115,3 +122,5 @@ pointToLatLng(point: PointExpression, zoom: number): LatLng;

export interface LatLng {
export class LatLng {
constructor(latitude: number, longitude: number, altitude?: number);
constructor(coords: LatLngTuple | [number, number, number] | LatLngLiteral | {lat: number, lng: number, alt?: number});
equals(otherLatLng: LatLngExpression, maxMargin?: number): boolean;

@@ -139,13 +148,8 @@ toString(): string;

export function latLng(coords: LatLngTuple): LatLng;
export function latLng(coords: LatLngTuple | [number, number, number] | LatLngLiteral | {lat: number, lng: number, alt?: number}): LatLng;
export function latLng(coords: [number, number, number]): LatLng;
export function latLng(coords: LatLngLiteral): LatLng;
export function latLng(coords: {lat: number, lng: number, alt: number}): LatLng;
export interface LatLngBounds {
extend(latlng: LatLngExpression): this;
extend(otherBounds: LatLngBoundsExpression): this;
export class LatLngBounds {
constructor(southWest: LatLngExpression, northEast: LatLngExpression);
constructor(latlngs: LatLngBoundsLiteral);
extend(latlngOrBounds: LatLngExpression | LatLngBoundsExpression): this;
pad(bufferRatio: number): LatLngBounds; // does this modify the current instance or does it return a new one?

@@ -161,4 +165,3 @@ getCenter(): LatLng;

getNorth(): number;
contains(otherBounds: LatLngBoundsExpression): boolean;
contains(latlng: LatLngExpression): boolean;
contains(otherBoundsOrLatLng: LatLngBoundsExpression | LatLngExpression): boolean;
intersects(otherBounds: LatLngBoundsExpression): boolean;

@@ -171,3 +174,3 @@ overlaps(otherBounds: BoundsExpression): boolean; // investigate if this is really bounds and not latlngbounds

export type LatLngBoundsLiteral = Array<LatLngTuple>;
export type LatLngBoundsLiteral = LatLngTuple[]; // Must be [LatLngTuple, LatLngTuple], cant't change because Map.setMaxBounds

@@ -182,3 +185,5 @@ type LatLngBoundsExpression = LatLngBounds | LatLngBoundsLiteral;

export interface Point {
export class Point {
constructor(x: number, y: number, round?: boolean);
constructor(coords: PointTuple | {x: number, y: number});
clone(): Point;

@@ -206,9 +211,9 @@ add(otherPoint: PointExpression): Point; // investigate if this mutates or returns a new instance

export function point(coords: PointTuple): Point;
export function point(coords: PointTuple | {x: number, y: number}): Point;
export function point(coords: {x: number, y: number}): Point;
export type BoundsLiteral = [PointTuple, PointTuple];
export type BoundsLiteral = Array<PointTuple>;
export interface Bounds {
export class Bounds {
constructor(topLeft: PointExpression, bottomRight: PointExpression);
constructor(points: Point[] | BoundsLiteral);
extend(point: PointExpression): this;

@@ -219,4 +224,3 @@ getCenter(round?: boolean): Point;

getSize(): Point;
contains(otherBounds: BoundsExpression): boolean;
contains(point: PointExpression): boolean;
contains(pointOrBounds: BoundsExpression | PointExpression): boolean;
intersects(otherBounds: BoundsExpression): boolean;

@@ -233,9 +237,9 @@ overlaps(otherBounds: BoundsExpression): boolean;

export function bounds(points: Array<Point>): Bounds;
export function bounds(points: Point[] | BoundsLiteral): Bounds;
export function bounds(points: BoundsLiteral): Bounds;
export type EventHandlerFn = (event: Event) => void;
export type EventHandlerFnMap = {[type: string]: EventHandlerFn};
export interface EventHandlerFnMap {
[type: string]: EventHandlerFn;
}

@@ -262,2 +266,3 @@ /**

/* tslint:disable:unified-signatures */ // With an eventMap there are no additional arguments allowed
/**

@@ -275,3 +280,3 @@ * Removes a previously added listener function. If no function is specified,

off(eventMap: EventHandlerFnMap): this;
/* tslint:enable */
/**

@@ -417,31 +422,19 @@ * Removes all listeners to all events on the object.

// Popup methods
bindPopup(content: string, options?: PopupOptions): this;
bindPopup(content: HTMLElement, options?: PopupOptions): this;
bindPopup(content: (layer: Layer) => Content, options?: PopupOptions): this;
bindPopup(content: Popup): this;
bindPopup(content: (layer: Layer) => Content | Content | Popup, options?: PopupOptions): this;
unbindPopup(): this;
openPopup(): this;
openPopup(latlng: LatLngExpression): this;
openPopup(latlng?: LatLngExpression): this;
closePopup(): this;
togglePopup(): this;
isPopupOpen(): boolean;
setPopupContent(content: string): this;
setPopupContent(content: HTMLElement): this;
setPopupContent(content: Popup): this;
setPopupContent(content: Content | Popup): this;
getPopup(): Popup;
// Tooltip methods
bindTooltip(content: string, options?: TooltipOptions): this;
bindTooltip(content: HTMLElement, options?: TooltipOptions): this;
bindTooltip(content: (layer: Layer) => Content, options?: TooltipOptions): this;
bindTooltip(content: Tooltip, options?: TooltipOptions): this;
bindTooltip(content: (layer: Layer) => Content | Tooltip | Content, options?: TooltipOptions): this;
unbindTooltip(): this;
openTooltip(): this;
openTooltip(latlng: LatLngExpression): this;
openTooltip(latlng?: LatLngExpression): this;
closeTooltip(): this;
toggleTooltip(): this;
isTooltipOpen(): boolean;
setTooltipContent(content: string): this;
setTooltipContent(content: HTMLElement): this;
setTooltipContent(content: Tooltip): this;
setTooltipContent(content: Content | Tooltip): this;
getTooltip(): Tooltip;

@@ -474,3 +467,4 @@

export interface GridLayer extends Layer {
export class GridLayer extends Layer {
constructor(options?: GridLayerOptions);
bringToFront(): this;

@@ -493,3 +487,4 @@ bringToBack(): this;

maxNativeZoom?: number;
subdomains?: string | Array<string>;
minNativeZoom?: number;
subdomains?: string | string[];
errorTileUrl?: string;

@@ -504,4 +499,7 @@ zoomOffset?: number;

export interface TileLayer extends GridLayer {
export class TileLayer extends GridLayer {
constructor(urlTemplate: string, options?: TileLayerOptions);
setUrl(url: string, noRedraw?: boolean): this;
options: TileLayerOptions;
}

@@ -511,2 +509,12 @@

export namespace TileLayer {
export class WMS extends TileLayer {
constructor(baseUrl: string, options: WMSOptions);
setParams(params: WMSParams, noRedraw?: boolean): this;
wmsParams: WMSParams;
options: WMSOptions;
}
}
export interface WMSOptions extends TileLayerOptions {

@@ -522,8 +530,16 @@ layers: string;

export interface WMS extends TileLayer {
setParams(params: any, noRedraw?: boolean): this;
export interface WMSParams {
format?: string;
layers: string;
request?: string;
service?: string;
styles?: string;
version?: string;
transparent?: boolean;
width?: number;
height?: number;
}
export namespace tileLayer {
export function wms(baseUrl: string, options?: WMSOptions): WMS;
export function wms(baseUrl: string, options?: WMSOptions): TileLayer.WMS;
}

@@ -539,3 +555,4 @@

export interface ImageOverlay extends Layer {
export class ImageOverlay extends Layer {
constructor(imageUrl: string, bounds: LatLngBoundsExpression, options?: ImageOverlayOptions);
setOpacity(opacity: number): this;

@@ -554,2 +571,4 @@ bringToFront(): this;

getElement(): HTMLImageElement;
options: ImageOverlayOptions;
}

@@ -582,3 +601,3 @@

export interface Path extends Layer {
export abstract class Path extends Layer {
redraw(): this;

@@ -588,2 +607,5 @@ setStyle(style: PathOptions): this;

bringToBack(): this;
getElement(): HTMLElement;
options: PathOptions;
}

@@ -596,28 +618,33 @@

interface InternalPolyline extends Path {
getLatLngs(): Array<LatLng>;
setLatLngs(latlngs: Array<LatLngExpression>): this;
class InternalPolyline extends Path {
getLatLngs(): LatLng[];
setLatLngs(latlngs: LatLngExpression[]): this;
isEmpty(): boolean;
getCenter(): LatLng;
getBounds(): LatLngBounds;
addLatLng(latlng: LatLngExpression): this;
addLatLng(latlng: Array<LatLngExpression>): this; // these three overloads aren't explicitly noted in the docs
addLatLng(latlng: LatLngExpression | LatLngExpression[]): this;
options: PolylineOptions;
}
export interface Polyline extends InternalPolyline {
toGeoJSON(): GeoJSON.LineString | GeoJSON.MultiLineString;
export class Polyline extends InternalPolyline {
constructor(latlngs: LatLngExpression[], options?: PolylineOptions);
toGeoJSON(): GeoJSONFeature<GeoJSONLineString | GeoJSONMultiLineString>;
feature: GeoJSONFeature<GeoJSONLineString | GeoJSONMultiLineString>;
}
export function polyline(latlngs: Array<LatLngExpression>, options?: PolylineOptions): Polyline;
export function polyline(latlngs: Array<Array<LatLngExpression>>, options?: PolylineOptions): Polyline;
export function polyline(latlngs: LatLngExpression[], options?: PolylineOptions): Polyline;
export interface Polygon extends InternalPolyline {
toGeoJSON(): GeoJSON.Polygon | GeoJSON.MultiPolygon;
export class Polygon extends InternalPolyline {
constructor(latlngs: LatLngExpression[], options?: PolylineOptions);
toGeoJSON(): GeoJSONFeature<GeoJSONPolygon | GeoJSONMultiPolygon>;
feature: GeoJSONFeature<GeoJSONPolygon | GeoJSONMultiPolygon>;
}
export function polygon(latlngs: Array<LatLngExpression>, options?: PolylineOptions): Polygon;
export function polygon(latlngs: LatLngExpression[], options?: PolylineOptions): Polygon;
export function polygon(latlngs: Array<Array<LatLngExpression>>, options?: PolylineOptions): Polygon;
export interface Rectangle extends Polygon {
export class Rectangle extends Polygon {
constructor(latLngBounds: LatLngBoundsExpression, options?: PolylineOptions);
setBounds(latLngBounds: LatLngBoundsExpression): this;

@@ -632,4 +659,5 @@ }

export interface CircleMarker extends Path {
toGeoJSON(): GeoJSON.Point;
export class CircleMarker extends Path {
constructor(latlng: LatLngExpression, options?: CircleMarkerOptions);
toGeoJSON(): GeoJSONFeature<GeoJSONPoint>;
setLatLng(latLng: LatLngExpression): this;

@@ -639,2 +667,5 @@ getLatLng(): LatLng;

getRadius(): number;
options: CircleMarkerOptions;
feature: GeoJSONFeature<GeoJSONPoint>;
}

@@ -644,14 +675,10 @@

export interface CircleOptions extends PathOptions {
radius?: number;
}
export interface Circle extends CircleMarker {
setRadius(radius: number): this;
getRadius(): number;
export class Circle extends CircleMarker {
constructor(latlng: LatLngExpression, options?: CircleMarkerOptions);
constructor(latlng: LatLngExpression, radius: number, options?: CircleMarkerOptions); // deprecated!
getBounds(): LatLngBounds;
}
export function circle(latlng: LatLngExpression, options?: CircleOptions): Circle;
export function circle(latlng: LatLngExpression, radius: number, options?: CircleOptions): Circle;
export function circle(latlng: LatLngExpression, options?: CircleMarkerOptions): Circle;
export function circle(latlng: LatLngExpression, radius: number, options?: CircleMarkerOptions): Circle; // deprecated!

@@ -662,12 +689,14 @@ export interface RendererOptions extends LayerOptions {

export interface Renderer extends Layer {}
export class Renderer extends Layer {
constructor(options?: RendererOptions);
export interface SVG extends Renderer {}
options: RendererOptions;
}
export class SVG extends Renderer {}
export namespace SVG {
export function create(name: string): SVGElement;
export function pointsToPath(rings: Array<Point>, close: boolean): string;
export function pointsToPath(rings: Array<PointTuple>, close: boolean): string;
export function pointsToPath(rings: PointExpression[], close: boolean): string;
}

@@ -677,3 +706,3 @@

export interface Canvas extends Renderer {}
export class Canvas extends Renderer {}

@@ -687,7 +716,8 @@ export function canvas(options?: RendererOptions): Canvas;

*/
export interface LayerGroup extends Layer {
export class LayerGroup extends Layer {
constructor(layers: Layer[]);
/**
* Returns a GeoJSON representation of the layer group (as a GeoJSON GeometryCollection).
* Returns a GeoJSON representation of the layer group (as a GeoJSON GeometryCollection, GeoJSONFeatureCollection or Multipoint).
*/
toGeoJSON(): GeoJSON.GeometryCollection;
toGeoJSON(): GeoJSONFeatureCollection<GeoJSONGeometryObject> | GeoJSONFeature<GeoJSONGeometryCollection | GeoJSONMultiPoint>;

@@ -700,12 +730,7 @@ /**

/**
* Removes the given layer from the group.
* Removes the layer with the given internal ID or the given layer from the group.
*/
removeLayer(layer: Layer): this;
removeLayer(layer: number | Layer): this;
/**
* Removes the layer with the given internal ID from the group.
*/
removeLayer(id: number): this;
/**
* Returns true if the given layer is currently added to the group.

@@ -724,3 +749,3 @@ */

*/
invoke(methodName: string, ...params: Array<any>): this;
invoke(methodName: string, ...params: any[]): this;

@@ -741,3 +766,3 @@ /**

*/
getLayers(): Array<Layer>;
getLayers(): Layer[];

@@ -753,2 +778,4 @@ /**

getLayerId(layer: Layer): number;
feature: GeoJSONFeatureCollection<GeoJSONGeometryObject> | GeoJSONFeature<GeoJSONGeometryCollection | GeoJSONMultiPoint>;
}

@@ -759,3 +786,3 @@

*/
export function layerGroup(layers: Array<Layer>): LayerGroup;
export function layerGroup(layers: Layer[]): LayerGroup;

@@ -766,3 +793,3 @@ /**

*/
export interface FeatureGroup extends LayerGroup {
export class FeatureGroup extends LayerGroup {
/**

@@ -793,5 +820,5 @@ * Sets the given path options to each layer of the group that has a setStyle method.

*/
export function featureGroup(layers?: Array<Layer>): FeatureGroup;
export function featureGroup(layers?: Layer[]): FeatureGroup;
type StyleFunction = (feature: GeoJSON.Feature<GeoJSON.GeometryObject>) => PathOptions;
type StyleFunction = (feature: GeoJSONFeature<GeoJSONGeometryObject>) => PathOptions;

@@ -812,3 +839,3 @@ export interface GeoJSONOptions extends LayerOptions {

*/
pointToLayer?: (geoJsonPoint: GeoJSON.Feature<GeoJSON.Point>, latlng: LatLng) => Layer; // should import GeoJSON typings
pointToLayer?: (geoJsonPoint: GeoJSONFeature<GeoJSONPoint>, latlng: LatLng) => Layer; // should import GeoJSON typings

@@ -839,3 +866,3 @@ /**

*/
onEachFeature?: (feature: GeoJSON.Feature<GeoJSON.GeometryObject>, layer: Layer) => void;
onEachFeature?: (feature: GeoJSONFeature<GeoJSONGeometryObject>, layer: Layer) => void;

@@ -853,3 +880,3 @@ /**

*/
filter?: (geoJsonFeature: GeoJSON.Feature<GeoJSON.GeometryObject>) => boolean;
filter?: (geoJsonFeature: GeoJSONFeature<GeoJSONGeometryObject>) => boolean;

@@ -863,3 +890,7 @@ /**

export class GeoJSON {
/**
* Represents a GeoJSON object or an array of GeoJSON objects.
* Allows you to parse GeoJSON data and display it on the map. Extends FeatureGroup.
*/
export class GeoJSON extends FeatureGroup {
/**

@@ -869,3 +900,3 @@ * Creates a Layer from a given GeoJSON feature. Can use a custom pointToLayer

*/
static geometryToLayer(featureData: GeoJSON.Feature<GeoJSON.GeometryObject>, options?: GeoJSONOptions): Layer;
static geometryToLayer(featureData: GeoJSONFeature<GeoJSONGeometryObject>, options?: GeoJSONOptions): Layer;

@@ -894,3 +925,2 @@ /**

/**

@@ -906,17 +936,9 @@ * Reverse of coordsToLatLngs closed determines whether the first point should be

*/
static asFeature(geojson: GeoJSON.GeometryObject): GeoJSON.Feature<GeoJSON.GeometryObject>;
static asFeature(geojson: GeoJSONFeature<GeoJSONGeometryObject> | GeoJSONGeometryObject): GeoJSONFeature<GeoJSONGeometryObject>;
static asFeature(geojson: GeoJSON.Feature<GeoJSON.GeometryObject>): GeoJSON.Feature<GeoJSON.GeometryObject>;
}
/**
* Represents a GeoJSON object or an array of GeoJSON objects.
* Allows you to parse GeoJSON data and display it on the map. Extends FeatureGroup.
*/
export interface GeoJSON extends FeatureGroup {
constructor(geojson?: GeoJSONGeoJsonObject, options?: GeoJSONOptions)
/**
* Adds a GeoJSON object to the layer.
*/
addData(data: GeoJSON.GeoJsonObject): Layer;
addData(data: GeoJSONGeoJsonObject): Layer;

@@ -934,2 +956,4 @@ /**

options: GeoJSONOptions;
}

@@ -944,3 +968,3 @@

*/
export function geoJSON(geojson?: GeoJSON.GeoJsonObject, options?: GeoJSONOptions): GeoJSON;
export function geoJSON(geojson?: GeoJSONGeoJsonObject, options?: GeoJSONOptions): GeoJSON;

@@ -971,3 +995,3 @@ type Zoom = boolean | 'center';

maxZoom?: number;
layers?: Array<Layer>;
layers?: Layer[];
maxBounds?: LatLngBoundsExpression;

@@ -1014,3 +1038,3 @@ renderer?: Renderer;

export class Control extends Class {
constructor (options?: ControlOptions);
constructor(options?: ControlOptions);
getPosition(): ControlPosition;

@@ -1025,2 +1049,4 @@ setPosition(position: ControlPosition): this;

onRemove(map: Map): void;
options: ControlOptions;
}

@@ -1036,3 +1062,6 @@

export interface Zoom extends Control {}
export class Zoom extends Control {
constructor(options?: ZoomOptions);
options: ZoomOptions;
}

@@ -1043,6 +1072,8 @@ export interface AttributionOptions extends ControlOptions {

export interface Attribution extends Control {
export class Attribution extends Control {
constructor(options?: AttributionOptions);
setPrefix(prefix: string): this;
addAttribution(text: string): this;
removeAttribution(text: string): this;
options: AttributionOptions;
}

@@ -1056,3 +1087,8 @@

export interface Layers extends Control {
interface LayersObject {
[name: string]: Layer;
}
export class Layers extends Control {
constructor(baseLayers?: LayersObject, overlays?: LayersObject, options?: Control.LayersOptions);
addBaseLayer(layer: Layer, name: string): this;

@@ -1063,2 +1099,3 @@ addOverlay(layer: Layer, name: string): this;

collapse(): this;
options: LayersOptions;
}

@@ -1073,14 +1110,15 @@

export interface Scale extends Control {}
export class Scale extends Control {
constructor(options?: Control.ScaleOptions);
options: ScaleOptions;
}
}
export namespace control {
export function zoom(options: Control.ZoomOptions): Control.Zoom;
export function zoom(options?: Control.ZoomOptions): Control.Zoom;
export function attribution(options: Control.AttributionOptions): Control.Attribution;
export function attribution(options?: Control.AttributionOptions): Control.Attribution;
type LayersObject = {[name: string]: Layer};
export function layers(baseLayers?: Control.LayersObject, overlays?: Control.LayersObject, options?: Control.LayersOptions): Control.Layers;
export function layers(baseLayers?: LayersObject, overlays?: LayersObject, options?: Control.LayersOptions): Control.Layers;
export function scale(options?: Control.ScaleOptions): Control.Scale;

@@ -1112,10 +1150,9 @@ }

export interface Popup extends Layer {
export class Popup extends Layer {
constructor(options?: PopupOptions, source?: Layer);
getLatLng(): LatLng;
setLatLng(latlng: LatLngExpression): this;
getContent(): Content;
setContent(htmlContent: string): this;
setContent(htmlContent: HTMLElement): this;
setContent(htmlContent: (source: Layer) => Content): this;
getElement(): Content;
setContent(htmlContent: (source: Layer) => Content | Content): this;
getElement(): HTMLElement;
update(): void;

@@ -1126,2 +1163,4 @@ isOpen(): boolean;

openOn(map: Map): this;
options: PopupOptions;
}

@@ -1143,4 +1182,18 @@

export interface Tooltip extends Layer {}
export class Tooltip extends Layer {
constructor(options?: TooltipOptions, source?: Layer);
setOpacity(val: number): void;
getLatLng(): LatLng;
setLatLng(latlng: LatLngExpression): this;
getContent(): Content;
setContent(htmlContent: (source: Layer) => Content | Content): this;
getElement(): HTMLElement;
update(): void;
isOpen(): boolean;
bringToFront(): this;
bringToBack(): this;
options: TooltipOptions;
}
export function tooltip(options?: TooltipOptions, source?: Layer): Tooltip;

@@ -1159,3 +1212,5 @@

/* tslint:disable:no-empty-interface */ // This is not empty, it extends two interfaces into one...
export interface ZoomPanOptions extends ZoomOptions, PanOptions {}
/* tslint:enable */

@@ -1178,3 +1233,4 @@ export interface FitBoundsOptions extends ZoomOptions, PanOptions {

export interface Handler {
export class Handler extends Class {
constructor(map: Map);
enable(): this;

@@ -1269,9 +1325,9 @@ disable(): this;

export namespace DomEvent {
export function on(el: HTMLElement, types: string, fn: (ev: Event) => any, context?: any): typeof DomEvent;
export function on(el: HTMLElement, types: string, fn: EventHandlerFn, context?: any): typeof DomEvent;
export function on(el: HTMLElement, eventMap: {[eventName: string]: Function}, context?: any): typeof DomEvent;
export function on(el: HTMLElement, eventMap: {[eventName: string]: EventHandlerFn}, context?: any): typeof DomEvent;
export function off(el: HTMLElement, types: string, fn: (ev: Event) => any, context?: any): typeof DomEvent;
export function off(el: HTMLElement, types: string, fn: EventHandlerFn, context?: any): typeof DomEvent;
export function off(el: HTMLElement, eventMap: {[eventName: string]: Function}, context?: any): typeof DomEvent;
export function off(el: HTMLElement, eventMap: {[eventName: string]: EventHandlerFn}, context?: any): typeof DomEvent;

@@ -1292,9 +1348,9 @@ export function stopPropagation(ev: Event): typeof DomEvent;

export function addListener(el: HTMLElement, types: string, fn: (ev: Event) => any, context?: any): typeof DomEvent;
export function addListener(el: HTMLElement, types: string, fn: EventHandlerFn, context?: any): typeof DomEvent;
export function addListener(el: HTMLElement, eventMap: {[eventName: string]: Function}, context?: any): typeof DomEvent;
export function addListener(el: HTMLElement, eventMap: {[eventName: string]: EventHandlerFn}, context?: any): typeof DomEvent;
export function removeListener(el: HTMLElement, types: string, fn: (ev: Event) => any, context?: any): typeof DomEvent;
export function removeListener(el: HTMLElement, types: string, fn: EventHandlerFn, context?: any): typeof DomEvent;
export function removeListener(el: HTMLElement, eventMap: {[eventName: string]: Function}, context?: any): typeof DomEvent;
export function removeListener(el: HTMLElement, eventMap: {[eventName: string]: EventHandlerFn}, context?: any): typeof DomEvent;
}

@@ -1312,3 +1368,4 @@

export interface Map extends Evented {
export class Map extends Evented {
constructor(element: string | HTMLElement, options?: MapOptions);
getRenderer(layer: Path): Renderer;

@@ -1324,8 +1381,6 @@

openPopup(popup: Popup): this;
openPopup(content: string, latlng: LatLngExpression, options?: PopupOptions): this;
openPopup(content: HTMLElement, latlng: LatLngExpression, options?: PopupOptions): this;
openPopup(content: Content, latlng: LatLngExpression, options?: PopupOptions): this;
closePopup(popup?: Popup): this;
openTooltip(tooltip: Tooltip): this;
openTooltip(content: string, latlng: LatLngExpression, options?: TooltipOptions): this;
openTooltip(content: HTMLElement, latlng: LatLngExpression, options?: TooltipOptions): this;
openTooltip(content: Content, latlng: LatLngExpression, options?: TooltipOptions): this;
closeTooltip(tooltip?: Tooltip): this;

@@ -1338,4 +1393,3 @@

zoomOut(delta?: number, options?: ZoomOptions): this;
setZoomAround(latlng: LatLngExpression, zoom: number, options?: ZoomOptions): this;
setZoomAround(offset: Point, zoom: number, options?: ZoomOptions): this;
setZoomAround(position: Point | LatLngExpression, zoom: number, options?: ZoomOptions): this;
fitBounds(bounds: LatLngBoundsExpression, options?: FitBoundsOptions): this;

@@ -1349,4 +1403,6 @@ fitWorld(options?: FitBoundsOptions): this;

panInsideBounds(bounds: LatLngBoundsExpression, options?: PanOptions): this;
invalidateSize(options: ZoomPanOptions): this;
invalidateSize(animate: boolean): this;
/**
* Boolean for animate or advanced ZoomPanOptions
*/
invalidateSize(options?: boolean | ZoomPanOptions): this;
stop(): this;

@@ -1360,4 +1416,6 @@ flyTo(latlng: LatLngExpression, zoom?: number, options?: ZoomPanOptions): this;

createPane(name: string, container?: HTMLElement): HTMLElement;
getPane(pane: string): HTMLElement;
getPane(pane: HTMLElement): HTMLElement;
/**
* Name of the pane or the pane as HTML-Element
*/
getPane(pane: string | HTMLElement): HTMLElement;
getPanes(): {[name: string]: HTMLElement} & DefaultMapPanes;

@@ -1390,3 +1448,2 @@ getContainer(): HTMLElement;

layerPointToContainerPoint(point: PointExpression): Point;
layerPointToContainerPoint(point: PointTuple): Point;
latLngToContainerPoint(latlng: LatLngExpression): Point;

@@ -1409,8 +1466,11 @@ mouseEventToContainerPoint(ev: MouseEvent): Point;

touchZoom: Handler;
options: MapOptions;
}
export function map(id: string, options?: MapOptions): Map;
/**
* ID of a HTML-Element as string or the HTML-ELement itself
*/
export function map(element: string | HTMLElement, options?: MapOptions): Map;
export function map(el: HTMLElement, options?: MapOptions): Map;
export interface IconOptions extends LayerOptions {

@@ -1429,18 +1489,14 @@ iconUrl: string;

export interface Icon extends Layer {
class InternalIcon extends Layer {
constructor(options: IconOptions);
createIcon(oldIcon?: HTMLElement): HTMLElement;
createShadow(oldIcon?: HTMLElement): HTMLElement;
}
export interface IconDefault extends Icon {
imagePath: string;
export class Icon extends InternalIcon {
createShadow(oldIcon?: HTMLElement): HTMLElement;
options: IconOptions;
}
export class Icon {
constructor(options: IconOptions);
}
export namespace Icon {
export class Default extends Icon {
constructor(options?: IconOptions);
export class Default extends InternalIcon {
imagePath: string;

@@ -1461,4 +1517,5 @@ }

export class DivIcon extends Icon {
export class DivIcon extends InternalIcon {
constructor(options?: DivIconOptions);
options: DivIconOptions;
}

@@ -1479,2 +1536,4 @@

riseOffset?: number;
options: DivIconOptions;
}

@@ -1489,5 +1548,6 @@

setOpacity(opacity: number): this;
getElement(): Element;
getElement(): HTMLElement;
// Properties
options: MarkerOptions;
dragging: Handler;

@@ -1527,2 +1587,3 @@ }

}
}

@@ -1529,0 +1590,0 @@

{
"name": "@types/leaflet",
"version": "1.0.50",
"version": "1.0.51",
"description": "TypeScript definitions for Leaflet.js",

@@ -17,4 +17,4 @@ "license": "MIT",

"peerDependencies": {},
"typesPublisherContentHash": "7f8bc7fc374adf4fc4bfff8e8f98efcc5c9dc4e65bb1a287dd33dfbab06153cb",
"typesPublisherContentHash": "e1feb5b38df03bebb29f68da3660e424f58966501d2697192b9da1fa3b2f0311",
"typeScriptVersion": "2.0"
}

@@ -11,3 +11,3 @@ # Installation

Additional Details
* Last updated: Thu, 26 Jan 2017 02:30:10 GMT
* Last updated: Tue, 07 Feb 2017 21:47:44 GMT
* Dependencies: geojson

@@ -14,0 +14,0 @@ * Global values: L

@@ -28,5 +28,5 @@ {

"hasPackageJson": false,
"contentHash": "7f8bc7fc374adf4fc4bfff8e8f98efcc5c9dc4e65bb1a287dd33dfbab06153cb"
"contentHash": "e1feb5b38df03bebb29f68da3660e424f58966501d2697192b9da1fa3b2f0311"
},
"isLatest": true
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc