@@ -80,6 +80,9 @@ def test_init(self):
8080 assert self .map .width == (900 , 'px' )
8181 assert self .map .left == (0 , '%' )
8282 assert self .map .top == (0 , '%' )
83+ assert self .map .global_switches .prefer_canvas is False
84+ assert self .map .global_switches .no_touch is False
85+ assert self .map .global_switches .disable_3d is False
8386 assert self .map .to_dict () == {
8487 "name" : "Map" ,
8588 "id" : "00000000000000000000000000000000" ,
@@ -422,3 +425,24 @@ def test_tile_layer(self):
422425
423426 bounds = self .map .get_bounds ()
424427 assert bounds == [[None , None ], [None , None ]], bounds
428+
429+ def test_global_switches (self ):
430+ mapa = folium .Map (prefer_canvas = True )
431+ assert (mapa .global_switches .prefer_canvas is True and
432+ mapa .global_switches .no_touch is False and
433+ mapa .global_switches .disable_3d is False )
434+
435+ mapb = folium .Map (no_touch = True )
436+ assert (mapb .global_switches .prefer_canvas is False and
437+ mapb .global_switches .no_touch is True and
438+ mapb .global_switches .disable_3d is False )
439+
440+ mapc = folium .Map (disable_3d = True )
441+ assert (mapc .global_switches .prefer_canvas is False and
442+ mapc .global_switches .no_touch is False and
443+ mapc .global_switches .disable_3d is True )
444+
445+ mapd = folium .Map (prefer_canvas = True , no_touch = True , disable_3d = True )
446+ assert (mapd .global_switches .prefer_canvas is True and
447+ mapd .global_switches .no_touch is True and
448+ mapd .global_switches .disable_3d is True )
0 commit comments