Skip to content

Commit

Permalink
Add Folium reference notebook (#2672)
Browse files Browse the repository at this point in the history
* add Folium reference

* clean up notebook

* Fix typo

* clear notebook
  • Loading branch information
maximlt authored Aug 27, 2021
1 parent 0380a8b commit ac04ed1
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions examples/reference/panes/Folium.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"source": [
"import folium\n",
"import panel as pn\n",
"\n",
"pn.extension(sizing_mode=\"stretch_width\")"
],
"outputs": [],
"metadata": {}
},
{
"cell_type": "markdown",
"source": [
"The ``Folium`` pane renders [folium](http://python-visualization.github.io/folium/) interactive maps.\n",
"\n",
"#### Parameters:\n",
"\n",
"For layout and styling related parameters see the [customization user guide](../../user_guide/Customization.ipynb).\n",
"\n",
"* **``object``** (object): The Folium object being displayed\n",
"___"
],
"metadata": {}
},
{
"cell_type": "markdown",
"source": [
"The `Folium` pane uses the built-in HTML representation provided by `folium` to render the map:"
],
"metadata": {}
},
{
"cell_type": "code",
"execution_count": null,
"source": [
"m = folium.Map(location=[52.51, 13.39], zoom_start=12)\n",
"\n",
"folium_pane = pn.pane.plot.Folium(m, height=400)\n",
"\n",
"folium_pane"
],
"outputs": [],
"metadata": {}
},
{
"cell_type": "markdown",
"source": [
"Like any other pane, the `Folium` pane's view can be updated by setting the `object` parameter:"
],
"metadata": {}
},
{
"cell_type": "code",
"execution_count": null,
"source": [
"# Add a marker to the map\n",
"folium.Marker(\n",
" [52.516, 13.381], popup=\"<i>Brandenburg Gate</i>\", tooltip=\"Click me!\"\n",
").add_to(m)\n",
"\n",
"folium_pane.object = m"
],
"outputs": [],
"metadata": {}
}
],
"metadata": {
"language_info": {
"name": "python",
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}

0 comments on commit ac04ed1

Please sign in to comment.