mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
Merge pull request #5902 from rimig/leaflet-layercontrolevent
Leaflet: Add LeafletLayersControlEvent
This commit is contained in:
@@ -148,6 +148,11 @@ map.closePopup();
|
||||
map.addControl(L.control.attribution({position: 'bottomright'}));
|
||||
map.removeControl(L.control.attribution({ position: 'bottomright' }));
|
||||
|
||||
L.control.layers({'Base': layer}).addTo(map);
|
||||
map.on('baseLayerChange', function(e: L.LeafletLayersControlEvent) {
|
||||
alert(e.name);
|
||||
});
|
||||
|
||||
map.latLngToLayerPoint(map.layerPointToLatLng(L.point(0, 0)));
|
||||
map.latLngToContainerPoint(map.containerPointToLatLng(L.point(0, 0)));
|
||||
map.containerPointToLayerPoint(L.point(0, 0));
|
||||
|
||||
Vendored
+16
@@ -1838,6 +1838,22 @@ declare namespace L {
|
||||
|
||||
declare namespace L {
|
||||
|
||||
export interface LeafletLayersControlEvent extends LeafletEvent {
|
||||
|
||||
/**
|
||||
* The layer that was added or removed.
|
||||
*/
|
||||
layer: ILayer;
|
||||
|
||||
/**
|
||||
* The name of the layer that was added or removed.
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare module L {
|
||||
|
||||
export interface LeafletLocationEvent extends LeafletEvent {
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user