Merge pull request #1 from jmblab/feature/leaflet-missing-map-eachLayer

Add L.Map.eachLayer method typing
This commit is contained in:
Marcin Żochowski
2015-12-07 18:36:26 +01:00
2 changed files with 10 additions and 3 deletions
+2 -1
View File
@@ -131,6 +131,7 @@ var layer = L.tileLayer("http://{s}.example.net/{x}/{y}/{z}.png");
map.addLayer(layer);
map.addLayer(layer, false);
map.eachLayer(l => {});
map.removeLayer(layer);
map.hasLayer(layer);
@@ -423,4 +424,4 @@ var zoomCtrl = L.control.zoom({
position: "topleft",
zoomInText: '+',
zoomOutText: '-'
});
});
+8 -2
View File
@@ -516,7 +516,7 @@ declare module L {
function (options?: ControlOptions): Control;
}
namespace control {
export namespace control {
/**
* Creates a zoom control.
@@ -2441,6 +2441,12 @@ declare namespace L {
*/
options: Map.MapOptions;
/**
* Iterates over the layers of the map, optionally specifying context
* of the iterator function.
*/
eachLayer(fn: (layer: ILayer) => void, context?: any): Map;
////////////////
////////////////
addEventListener(type: string, fn: (e: LeafletEvent) => void, context?: any): Map;
@@ -3261,7 +3267,7 @@ declare namespace L {
off(eventMap?: any, context?: any): Path;
}
namespace Path {
export namespace Path {
/**
* True if SVG is used for vector rendering (true for most modern browsers).
*/