diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 7a0f090a..9bdb40a2 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -60,6 +60,10 @@ The basic workflow for contributing is:
    git checkout -b name-of-your-branch
    ```
 4. Install the dependencies listed in `requirements.txt` and `requirements-dev.txt`.
+   ```
+   pip install -r requirements.txt
+   pip install -r requirements-dev.txt
+   ```
 5. Install Firefox, download [geckodriver](https://github.com/mozilla/geckodriver/releases) 
    and put it in the PATH.
 6. Make changes to your local copy of the folium repository
diff --git a/folium/folium.py b/folium/folium.py
index ac1e1ea8..bf5eb17d 100644
--- a/folium/folium.py
+++ b/folium/folium.py
@@ -55,16 +55,14 @@ class GlobalSwitches(Element):
 
     _template = Template("""
         <script>
-            L_PREFER_CANVAS = {{ this.prefer_canvas|tojson }};
             L_NO_TOUCH = {{ this.no_touch |tojson}};
             L_DISABLE_3D = {{ this.disable_3d|tojson }};
         </script>
     """)
 
-    def __init__(self, prefer_canvas=False, no_touch=False, disable_3d=False):
+    def __init__(self, no_touch=False, disable_3d=False):
         super(GlobalSwitches, self).__init__()
         self._name = 'GlobalSwitches'
-        self.prefer_canvas = prefer_canvas
         self.no_touch = no_touch
         self.disable_3d = disable_3d
 
@@ -269,11 +267,11 @@ class Map(MacroElement):
             max_bounds=max_bounds_array,
             zoom=zoom_start,
             zoom_control=zoom_control,
+            prefer_canvas=prefer_canvas,
             **kwargs
         )
 
         self.global_switches = GlobalSwitches(
-            prefer_canvas,
             no_touch,
             disable_3d
         )

Performance issue when trying to draw lots of markers: prefer_canvas option inefficient
Trying to plot thousands of circleMarkers, it appeared that rendering the map was very slow.

I tried to use the `prefer_canvas` option during Map creation:
```python

carte = folium.Map(
        location=[48, 8.33],
        tiles='Mapbox Bright',
        prefer_canvas=True,
    )

```
but didn't see any performance improvement. Looking into the generated html, it seems that the  `prefer_canvas` option is rendered as a Global Switch:

```javascript
<script>
            L_PREFER_CANVAS = true;
            L_NO_TOUCH = false;
            L_DISABLE_3D = false;
</script>
```

Unfortunately, it seems that the `L_PREFER_CANVAS` switch isn't supported anymore since Leaflet 1.0, the prefered way of using Canvas is now during the map creation (https://leafletjs.com/reference-1.4.0.html#map-prefercanvas).

Adding directly the ```preferCanvas: true``` option in the html, I saw a huge speed improvement in the drawing of the markers.
diff --git a/tests/test_folium.py b/tests/test_folium.py
index d2e302fe..baab9b04 100644
--- a/tests/test_folium.py
+++ b/tests/test_folium.py
@@ -103,7 +103,6 @@ class TestFolium(object):
         assert self.m.width == (900, 'px')
         assert self.m.left == (0, '%')
         assert self.m.top == (0, '%')
-        assert self.m.global_switches.prefer_canvas is False
         assert self.m.global_switches.no_touch is False
         assert self.m.global_switches.disable_3d is False
         assert self.m.to_dict() == {
@@ -278,7 +277,7 @@ class TestFolium(object):
                                               'padding': (3, 3), },
                                              sort_keys=True),
             'this': fitbounds,
-            })
+        })
 
         assert ''.join(fit_bounds_rendered.split()) in ''.join(out.split())
 
@@ -310,22 +309,30 @@ class TestFolium(object):
 
     def test_global_switches(self):
         m = folium.Map(prefer_canvas=True)
-        assert m.global_switches.prefer_canvas
+        out = m._parent.render()
+        out_str = ''.join(out.split())
+        assert "preferCanvas:true" in out_str
         assert not m.global_switches.no_touch
         assert not m.global_switches.disable_3d
 
         m = folium.Map(no_touch=True)
-        assert not m.global_switches.prefer_canvas
+        out = m._parent.render()
+        out_str = ''.join(out.split())
+        assert "preferCanvas:false" in out_str
         assert m.global_switches.no_touch
         assert not m.global_switches.disable_3d
 
         m = folium.Map(disable_3d=True)
-        assert not m.global_switches.prefer_canvas
+        out = m._parent.render()
+        out_str = ''.join(out.split())
+        assert "preferCanvas:false" in out_str
         assert not m.global_switches.no_touch
         assert m.global_switches.disable_3d
 
         m = folium.Map(prefer_canvas=True, no_touch=True, disable_3d=True)
-        assert m.global_switches.prefer_canvas
+        out = m._parent.render()
+        out_str = ''.join(out.split())
+        assert "preferCanvas:true" in out_str
         assert m.global_switches.no_touch
         assert m.global_switches.disable_3d
 

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest
3.9
requirements.txt requirements-dev.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.16
altair==5.5.0
asttokens==3.0.0
attrs==25.3.0
babel==2.17.0
backports.tarfile==1.2.0
beautifulsoup4==4.13.3
bleach==6.2.0
branca==0.8.1
Cartopy==0.23.0
certifi==2025.1.31
cffi==1.17.1
charset-normalizer==3.4.1
comm==0.2.2
contourpy==1.3.0
coverage==7.8.0
cryptography==44.0.2
cycler==0.12.1
debugpy==1.8.13
decorator==5.2.1
defusedxml==0.7.1
descartes==1.1.0
docutils==0.21.2
exceptiongroup==1.2.2
execnet==2.1.1
executing==2.2.0
fastjsonschema==2.21.1
flake8==7.2.0
flake8-builtins==2.5.0
flake8-comprehensions==3.16.0
flake8-import-order==0.18.2
flake8-mutable==1.2.0
flake8-quotes==3.4.0
-e git+https://github.com/python-visualization/folium.git@8595240517135d1637ca4cf7cc624045f1d911b3#egg=folium
fonttools==4.56.0
geographiclib==2.0
geopandas==1.0.1
gpxpy==1.6.2
h11==0.14.0
id==1.5.0
idna==3.10
imagesize==1.4.1
importlib_metadata==8.6.1
importlib_resources==6.5.2
iniconfig==2.1.0
ipykernel==6.29.5
ipython==8.18.1
jaraco.classes==3.4.0
jaraco.context==6.0.1
jaraco.functools==4.1.0
jedi==0.19.2
jeepney==0.9.0
Jinja2==3.1.6
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
jupyter_client==8.6.3
jupyter_core==5.7.2
jupyterlab_pygments==0.3.0
keyring==25.6.0
kiwisolver==1.4.7
lxml==5.3.1
markdown-it-py==3.0.0
MarkupSafe==3.0.2
matplotlib==3.9.4
matplotlib-inline==0.1.7
mccabe==0.7.0
mdurl==0.1.2
mistune==3.1.3
more-itertools==10.6.0
mplleaflet==0.0.5
narwhals==1.32.0
nbclient==0.10.2
nbconvert==7.16.6
nbformat==5.10.4
nbsphinx==0.9.7
nbval==0.11.0
nest-asyncio==1.6.0
nh3==0.2.21
numpy==2.0.2
outcome==1.3.0.post0
OWSLib==0.31.0
packaging==24.2
pandas==2.2.3
pandocfilters==1.5.1
parso==0.8.4
pexpect==4.9.0
pillow==11.1.0
platformdirs==4.3.7
pluggy==1.5.0
prompt_toolkit==3.0.50
psutil==7.0.0
ptyprocess==0.7.0
pure_eval==0.2.3
pycodestyle==2.13.0
pycparser==2.22
pyflakes==3.3.1
Pygments==2.19.1
pyogrio==0.10.0
pyparsing==3.2.3
pyproj==3.6.1
pyshp==2.3.1
PySocks==1.7.1
pytest==8.3.5
pytest-cov==6.0.0
pytest-flake8==1.3.0
pytest-xdist==3.6.1
python-dateutil==2.9.0.post0
pytz==2025.2
PyYAML==6.0.2
pyzmq==26.3.0
readme_renderer==44.0
referencing==0.36.2
requests==2.32.3
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==14.0.0
rpds-py==0.24.0
scipy==1.13.1
SecretStorage==3.3.3
selenium==4.30.0
shapely==2.0.7
six==1.17.0
sniffio==1.3.1
snowballstemmer==2.2.0
sortedcontainers==2.4.0
soupsieve==2.6
Sphinx==7.4.7
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
stack-data==0.6.3
tinycss2==1.4.0
tomli==2.2.1
tornado==6.4.2
traitlets==5.14.3
trio==0.29.0
trio-websocket==0.12.2
twine==6.1.0
typing_extensions==4.13.0
tzdata==2025.2
urllib3==2.3.0
vega-datasets==0.9.0
vincent==0.4.4
wcwidth==0.2.13
webencodings==0.5.1
websocket-client==1.8.0
wsproto==1.2.0
zipp==3.21.0

name: folium
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.16
      - altair==5.5.0
      - asttokens==3.0.0
      - attrs==25.3.0
      - babel==2.17.0
      - backports-tarfile==1.2.0
      - beautifulsoup4==4.13.3
      - bleach==6.2.0
      - branca==0.8.1
      - cartopy==0.23.0
      - certifi==2025.1.31
      - cffi==1.17.1
      - charset-normalizer==3.4.1
      - comm==0.2.2
      - contourpy==1.3.0
      - coverage==7.8.0
      - cryptography==44.0.2
      - cycler==0.12.1
      - debugpy==1.8.13
      - decorator==5.2.1
      - defusedxml==0.7.1
      - descartes==1.1.0
      - docutils==0.21.2
      - exceptiongroup==1.2.2
      - execnet==2.1.1
      - executing==2.2.0
      - fastjsonschema==2.21.1
      - flake8==7.2.0
      - flake8-builtins==2.5.0
      - flake8-comprehensions==3.16.0
      - flake8-import-order==0.18.2
      - flake8-mutable==1.2.0
      - flake8-quotes==3.4.0
      - fonttools==4.56.0
      - geographiclib==2.0
      - geopandas==1.0.1
      - gpxpy==1.6.2
      - h11==0.14.0
      - id==1.5.0
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==8.6.1
      - importlib-resources==6.5.2
      - iniconfig==2.1.0
      - ipykernel==6.29.5
      - ipython==8.18.1
      - jaraco-classes==3.4.0
      - jaraco-context==6.0.1
      - jaraco-functools==4.1.0
      - jedi==0.19.2
      - jeepney==0.9.0
      - jinja2==3.1.6
      - jsonschema==4.23.0
      - jsonschema-specifications==2024.10.1
      - jupyter-client==8.6.3
      - jupyter-core==5.7.2
      - jupyterlab-pygments==0.3.0
      - keyring==25.6.0
      - kiwisolver==1.4.7
      - lxml==5.3.1
      - markdown-it-py==3.0.0
      - markupsafe==3.0.2
      - matplotlib==3.9.4
      - matplotlib-inline==0.1.7
      - mccabe==0.7.0
      - mdurl==0.1.2
      - mistune==3.1.3
      - more-itertools==10.6.0
      - mplleaflet==0.0.5
      - narwhals==1.32.0
      - nbclient==0.10.2
      - nbconvert==7.16.6
      - nbformat==5.10.4
      - nbsphinx==0.9.7
      - nbval==0.11.0
      - nest-asyncio==1.6.0
      - nh3==0.2.21
      - numpy==2.0.2
      - outcome==1.3.0.post0
      - owslib==0.31.0
      - packaging==24.2
      - pandas==2.2.3
      - pandocfilters==1.5.1
      - parso==0.8.4
      - pexpect==4.9.0
      - pillow==11.1.0
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - prompt-toolkit==3.0.50
      - psutil==7.0.0
      - ptyprocess==0.7.0
      - pure-eval==0.2.3
      - pycodestyle==2.13.0
      - pycparser==2.22
      - pyflakes==3.3.1
      - pygments==2.19.1
      - pyogrio==0.10.0
      - pyparsing==3.2.3
      - pyproj==3.6.1
      - pyshp==2.3.1
      - pysocks==1.7.1
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - pytest-flake8==1.3.0
      - pytest-xdist==3.6.1
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - pyyaml==6.0.2
      - pyzmq==26.3.0
      - readme-renderer==44.0
      - referencing==0.36.2
      - requests==2.32.3
      - requests-toolbelt==1.0.0
      - rfc3986==2.0.0
      - rich==14.0.0
      - rpds-py==0.24.0
      - scipy==1.13.1
      - secretstorage==3.3.3
      - selenium==4.30.0
      - shapely==2.0.7
      - six==1.17.0
      - sniffio==1.3.1
      - snowballstemmer==2.2.0
      - sortedcontainers==2.4.0
      - soupsieve==2.6
      - sphinx==7.4.7
      - sphinxcontrib-applehelp==2.0.0
      - sphinxcontrib-devhelp==2.0.0
      - sphinxcontrib-htmlhelp==2.1.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==2.0.0
      - sphinxcontrib-serializinghtml==2.0.0
      - stack-data==0.6.3
      - tinycss2==1.4.0
      - tomli==2.2.1
      - tornado==6.4.2
      - traitlets==5.14.3
      - trio==0.29.0
      - trio-websocket==0.12.2
      - twine==6.1.0
      - typing-extensions==4.13.0
      - tzdata==2025.2
      - urllib3==2.3.0
      - vega-datasets==0.9.0
      - vincent==0.4.4
      - wcwidth==0.2.13
      - webencodings==0.5.1
      - websocket-client==1.8.0
      - wsproto==1.2.0
      - zipp==3.21.0
prefix: /opt/conda/envs/folium

tests/test_folium.py::TestFolium::test_global_switches
tests/test_folium.py::TestFolium::test_init tests/test_folium.py::TestFolium::test_choropleth_features tests/test_folium.py::TestFolium::test_choropleth_warning tests/test_folium.py::TestFolium::test_fit_bounds tests/test_folium.py::TestFolium::test_custom_icon
tests/test_folium.py::test_get_templates tests/test_folium.py::test_location_args tests/test_folium.py::TestFolium::test_builtin_tile tests/test_folium.py::TestFolium::test_custom_tile tests/test_folium.py::TestFolium::test_feature_group tests/test_folium.py::TestFolium::test_topo_json_smooth_factor tests/test_folium.py::TestFolium::test_tile_attr_unicode tests/test_folium.py::TestFolium::test_json_request
.github/CONTRIBUTING.md folium/folium.py
.github/CONTRIBUTING.md folium/folium.py