File tree Expand file tree Collapse file tree 4 files changed +50
-1
lines changed 
streamlit_folium/frontend/public Expand file tree Collapse file tree 4 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 1+ import  folium 
2+ import  streamlit  as  st 
3+ from  folium .plugins  import  GroupedLayerControl 
4+ 
5+ from  streamlit_folium  import  st_folium 
6+ 
7+ st .set_page_config (
8+     page_title = "streamlit-folium documentation: Grouped Layer Control" ,
9+     page_icon = ":pencil:" ,
10+     layout = "wide" ,
11+ )
12+ 
13+ st .title ("streamlit-folium: Grouped Layer Control" )
14+ 
15+ m  =  folium .Map ([40.0 , 70.0 ], zoom_start = 6 )
16+ 
17+ fg1  =  folium .FeatureGroup (name = "g1" )
18+ fg2  =  folium .FeatureGroup (name = "g2" )
19+ fg3  =  folium .FeatureGroup (name = "g3" )
20+ folium .Marker ([40 , 74 ]).add_to (fg1 )
21+ folium .Marker ([38 , 72 ]).add_to (fg2 )
22+ folium .Marker ([40 , 72 ]).add_to (fg3 )
23+ m .add_child (fg1 )
24+ m .add_child (fg2 )
25+ m .add_child (fg3 )
26+ 
27+ folium .LayerControl (collapsed = False ).add_to (m )
28+ 
29+ GroupedLayerControl (
30+     groups = {"groups1" : [fg1 , fg2 ]},
31+     collapsed = False ,
32+ ).add_to (m )
33+ 
34+ st_folium (m )
Original file line number Diff line number Diff line change 22
33setuptools .setup (
44    name = "streamlit_folium" ,
5-     version = "0.15.1 " ,
5+     version = "0.16.0 " ,
66    author = "Randy Zwitch" ,
7788    description = "Render Folium objects in Streamlit" ,
Original file line number Diff line number Diff line change 5050    < script  src ="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js "> </ script > 
5151    < script  src ="https://cdnjs.cloudflare.com/ajax/libs/leaflet-locatecontrol/0.66.2/L.Control.Locate.min.js "> </ script > 
5252    < script  src ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/Leaflet.VectorGrid.bundled.js "
> </ script >  53+     < script  src ="https://cdnjs.cloudflare.com/ajax/libs/leaflet-groupedlayercontrol/0.6.1/leaflet.groupedlayercontrol.min.js "> </ script > 
5354
5455    < link 
5556      rel ="stylesheet "
147148      rel ="stylesheet "
148149      href ="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css "
149150    /> 
151+     < link 
152+       rel ="stylesheet "
153+       href ="https://cdnjs.cloudflare.com/ajax/libs/leaflet-groupedlayercontrol/0.6.1/leaflet.groupedlayercontrol.min.css "
154+     /> 
150155    < style > 
151156      .single  >  : nth-child (1 ) {
152157        width :  100%  ;
Original file line number Diff line number Diff line change @@ -242,3 +242,13 @@ def test_geojson_styles(page: Page):
242242
243243    page .get_by_text ("Show generated code" ).click ()
244244    expect (page .get_by_text ('"fillOpacity"' )).to_be_visible ()
245+ 
246+ 
247+ def  test_grouped_layer_control (page : Page ):
248+     page .get_by_role ("link" , name = "grouped layer control" ).click ()
249+     page .frame_locator ('iframe[title="streamlit_folium\\ .st_folium"]' ).locator (
250+         "label" 
251+     ).filter (has_text = "g2" ).click ()
252+     page .frame_locator ('iframe[title="streamlit_folium\\ .st_folium"]' ).get_by_label (
253+         "g2" 
254+     ).check ()
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments