File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,11 @@ map.closePopup();
148
148
map . addControl ( L . control . attribution ( { position : 'bottomright' } ) ) ;
149
149
map . removeControl ( L . control . attribution ( { position : 'bottomright' } ) ) ;
150
150
151
+ L . control . layers ( { 'Base' : layer } ) . addTo ( map ) ;
152
+ map . on ( 'baseLayerChange' , function ( e : L . LeafletLayersControlEvent ) {
153
+ alert ( e . name ) ;
154
+ } ) ;
155
+
151
156
map . latLngToLayerPoint ( map . layerPointToLatLng ( L . point ( 0 , 0 ) ) ) ;
152
157
map . latLngToContainerPoint ( map . containerPointToLatLng ( L . point ( 0 , 0 ) ) ) ;
153
158
map . containerPointToLayerPoint ( L . point ( 0 , 0 ) ) ;
Original file line number Diff line number Diff line change @@ -1835,6 +1835,22 @@ declare module L {
1835
1835
}
1836
1836
}
1837
1837
1838
+ declare module L {
1839
+
1840
+ export interface LeafletLayersControlEvent extends LeafletEvent {
1841
+
1842
+ /**
1843
+ * The layer that was added or removed.
1844
+ */
1845
+ layer : ILayer ;
1846
+
1847
+ /**
1848
+ * The name of the layer that was added or removed.
1849
+ */
1850
+ name : string ;
1851
+ }
1852
+ }
1853
+
1838
1854
declare module L {
1839
1855
1840
1856
export interface LeafletLocationEvent extends LeafletEvent {
You can’t perform that action at this time.
0 commit comments