diff --git a/README.rst b/README.rst index afabaf11a3..efa3c932da 100644 --- a/README.rst +++ b/README.rst @@ -60,6 +60,24 @@ and we'd love to have you hang out in our community. See `our complete contributor's guide `_ for more info. +Examples +-------- + +Explore some use cases and working examples in the ``examples/`` directory: + +- `Interactive Map Example `_: A simple example showing how to create a map with markers and popups using Python. +- Launch examples in a live environment via |binder|. +This example shows how to create an interactive map using `folium` with a marker and popup. +To run this example, navigate to the folium repo root and run: + +.. code:: bash + + python examples/interactive_map_example.py + +This will create an HTML file called `interactive_map_example.html` that can be opened in any web browser. +The resulting map is centered on San Francisco and includes a popup marker labeled "San Francisco". + + Changelog --------- diff --git a/examples/interactive_map_example.py b/examples/interactive_map_example.py new file mode 100644 index 0000000000..0d36266950 --- /dev/null +++ b/examples/interactive_map_example.py @@ -0,0 +1,10 @@ +import folium + +# Create a basic map +m = folium.Map(location=[37.7749, -122.4194], zoom_start=12) + +# Add a marker +folium.Marker([37.7749, -122.4194], popup="San Francisco").add_to(m) + +# Save to HTML +m.save("interactive_map_example.html")