diff --git a/leaflet/leaflet-tests.ts b/leaflet/leaflet-tests.ts index 6ab018a4e..0ea66d32e 100755 --- a/leaflet/leaflet-tests.ts +++ b/leaflet/leaflet-tests.ts @@ -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)); diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 760ecd283..110bdd6f7 100755 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -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 { /**