Skip to content

Commit af028c2

Browse files
committed
deploy: 5c46067
1 parent 896dd3d commit af028c2

File tree

160 files changed

+13971
-13019
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+13971
-13019
lines changed

latest/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 82805254dedfd30ef4e3be6097f6878e
3+
config: 1e7b84d6a2ce813ffa9ff2abc58ab04b
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
4.39 KB
Loading

latest/_sources/advanced_guide.rst.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ Advanced guide
1515
advanced_guide/piechart_icons
1616
advanced_guide/polygons_from_list_of_points
1717
advanced_guide/customize_javascript_and_css
18+
advanced_guide/override_leaflet_class_methods
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Overriding Leaflet class methods
2+
3+
```{code-cell} ipython3
4+
---
5+
nbsphinx: hidden
6+
---
7+
import folium
8+
```
9+
10+
## Customizing Leaflet behavior
11+
Sometimes you want to override Leaflet's javascript behavior. This can be done using the `Class.include` statement. This mimics Leaflet's
12+
`L.Class.include` method. See [here](https://leafletjs.com/examples/extending/extending-1-classes.html) for more details.
13+
14+
### Example: adding an authentication header to a TileLayer
15+
One such use case is if you need to override the `createTile` on `L.TileLayer`, because your tiles are hosted on an oauth2 protected
16+
server. This can be done like this:
17+
18+
```{code-cell}
19+
create_tile = folium.JsCode("""
20+
function(coords, done) {
21+
const url = this.getTileUrl(coords);
22+
const img = document.createElement('img');
23+
fetch(url, {
24+
headers: {
25+
"Authorization": "Bearer <Token>"
26+
},
27+
})
28+
.then((response) => {
29+
img.src = URL.createObjectURL(response.body);
30+
done(null, img);
31+
})
32+
return img;
33+
}
34+
""")
35+
36+
folium.TileLayer.include(create_tile=create_tile)
37+
tiles = folium.TileLayer(
38+
tiles="OpenStreetMap",
39+
)
40+
m = folium.Map(
41+
tiles=tiles,
42+
)
43+
44+
45+
m = folium.Map()
46+
```

latest/_static/documentation_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const DOCUMENTATION_OPTIONS = {
2-
VERSION: '0.19.7',
2+
VERSION: '0.20.0',
33
LANGUAGE: 'en',
44
COLLAPSE_INDEX: false,
55
BUILDER: 'html',

latest/_static/switcher.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
"url": "https://python-visualization.github.io/folium/dev/"
55
},
66
{
7-
"name": "latest (0.19.6)",
8-
"version": "0.19.6",
7+
"name": "latest (0.19.7)",
8+
"version": "0.19.7",
99
"url": "https://python-visualization.github.io/folium/latest/"
1010
},
11+
{
12+
"version": "0.19.6",
13+
"url": "https://python-visualization.github.io/folium/v0.19.6/"
14+
},
1115
{
1216
"version": "0.19.5",
1317
"url": "https://python-visualization.github.io/folium/v0.19.5/"

latest/advanced_guide.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<meta charset="utf-8" />
99
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
1010

11-
<title>Advanced guide &#8212; Folium 0.19.7 documentation</title>
11+
<title>Advanced guide &#8212; Folium 0.20.0 documentation</title>
1212

1313

1414

@@ -39,15 +39,15 @@
3939
<link rel="preload" as="script" href="_static/scripts/bootstrap.js?digest=8878045cc6db502f8baf" />
4040
<link rel="preload" as="script" href="_static/scripts/pydata-sphinx-theme.js?digest=8878045cc6db502f8baf" />
4141

42-
<script src="_static/documentation_options.js?v=0072a19d"></script>
42+
<script src="_static/documentation_options.js?v=b52c616d"></script>
4343
<script src="_static/doctools.js?v=9bcbadda"></script>
4444
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
4545
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
4646
<script>DOCUMENTATION_OPTIONS.pagename = 'advanced_guide';</script>
4747
<script>
4848
DOCUMENTATION_OPTIONS.theme_version = '0.16.1';
4949
DOCUMENTATION_OPTIONS.theme_switcher_json_url = 'https://python-visualization.github.io/folium/dev/_static/switcher.json';
50-
DOCUMENTATION_OPTIONS.theme_switcher_version_match = '0.19.7';
50+
DOCUMENTATION_OPTIONS.theme_switcher_version_match = '0.20.0';
5151
DOCUMENTATION_OPTIONS.show_version_warning_banner =
5252
false;
5353
</script>
@@ -57,7 +57,7 @@
5757
<link rel="prev" title="TimestampedWmsTileLayers" href="user_guide/plugins/WmsTimeDimension.html" />
5858
<meta name="viewport" content="width=device-width, initial-scale=1"/>
5959
<meta name="docsearch:language" content="en"/>
60-
<meta name="docsearch:version" content="0.19.7" />
60+
<meta name="docsearch:version" content="0.20.0" />
6161
</head>
6262

6363

@@ -373,6 +373,7 @@
373373
<li class="toctree-l1"><a class="reference internal" href="advanced_guide/piechart_icons.html">Piechart icons</a></li>
374374
<li class="toctree-l1"><a class="reference internal" href="advanced_guide/polygons_from_list_of_points.html">Creating a polygon from a list of points</a></li>
375375
<li class="toctree-l1"><a class="reference internal" href="advanced_guide/customize_javascript_and_css.html">Customizing javascript or css resources</a></li>
376+
<li class="toctree-l1"><a class="reference internal" href="advanced_guide/override_leaflet_class_methods.html">Overriding Leaflet class methods</a></li>
376377
</ul>
377378
</div>
378379
</nav></div>
@@ -445,6 +446,7 @@ <h1>Advanced guide<a class="headerlink" href="#advanced-guide" title="Link to th
445446
<li class="toctree-l1"><a class="reference internal" href="advanced_guide/piechart_icons.html">Piechart icons</a></li>
446447
<li class="toctree-l1"><a class="reference internal" href="advanced_guide/polygons_from_list_of_points.html">Creating a polygon from a list of points</a></li>
447448
<li class="toctree-l1"><a class="reference internal" href="advanced_guide/customize_javascript_and_css.html">Customizing javascript or css resources</a></li>
449+
<li class="toctree-l1"><a class="reference internal" href="advanced_guide/override_leaflet_class_methods.html">Overriding Leaflet class methods</a></li>
448450
</ul>
449451
</div>
450452
</section>
@@ -519,7 +521,7 @@ <h3>This Page</h3>
519521
<div class="footer-items__start">
520522

521523
<div class="footer-item"><!-- This will display the version of the docs -->
522-
Folium version 0.19.7</div>
524+
Folium version 0.20.0</div>
523525

524526
<div class="footer-item">
525527

latest/advanced_guide/choropleth with Jenks natural breaks optimization.html

Lines changed: 70 additions & 69 deletions
Large diffs are not rendered by default.

latest/advanced_guide/choropleth with Jenks natural breaks optimization.ipynb

Lines changed: 90 additions & 90 deletions
Large diffs are not rendered by default.

latest/advanced_guide/colormaps.html

Lines changed: 72 additions & 71 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)