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 @@ -1838,6 +1838,22 @@ declare namespace L {
1838
1838
1839
1839
declare namespace L {
1840
1840
1841
+ export interface LeafletLayersControlEvent extends LeafletEvent {
1842
+
1843
+ /**
1844
+ * The layer that was added or removed.
1845
+ */
1846
+ layer : ILayer ;
1847
+
1848
+ /**
1849
+ * The name of the layer that was added or removed.
1850
+ */
1851
+ name : string ;
1852
+ }
1853
+ }
1854
+
1855
+ declare module L {
1856
+
1841
1857
export interface LeafletLocationEvent extends LeafletEvent {
1842
1858
1843
1859
/**
You can’t perform that action at this time.
0 commit comments