Installation
npm install --save @types/leaflet-contextmenu
Summary
This package contains type definitions for leaflet-contextmenu (https://github.com/aratcliffe/Leaflet.contextmenu).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/leaflet-contextmenu.
index.d.ts
import { LatLng, Marker, Path, Point } from "leaflet";
declare module "leaflet" {
interface ContextMenuItem {
text: string;
icon?: string;
retinaIcon?: string;
iconCls?: string;
retinaIconCls?: string;
disabled?: boolean;
separator?: boolean;
hideOnSelect?: boolean;
index?: number;
// map is the scope where contextmenu is defined.
callback?: (ev: ContextMenuItemClickEvent, map?: Map) => void;
}
interface MapOptions {
contextmenu: boolean;
contextmenuItems: ContextMenuItem[];
}
interface MarkerOptions {
contextmenu: boolean;
contextmenuItems: ContextMenuItem[];
}
interface ContextMenuItemClickEvent {
latlng: LatLng;
layerPoint: Point;
containerPoint: Point;
relatedTarget: Marker | Path | undefined;
}
}
Additional Details
- Last updated: Tue, 07 Nov 2023 09:09:38 GMT
- Dependencies: @types/leaflet
Credits
These definitions were written by Antonio Vida.