Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/user_guide/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Plugins
plugins/float_image
plugins/fullscreen
plugins/geocoder
plugins/geoman
plugins/grouped_layer_control
plugins/heatmap
plugins/heatmap_with_time
Expand Down Expand Up @@ -65,6 +66,8 @@ Plugins
- A fullscreen button control for modern browsers, using HTML Fullscreen API.
* - :doc:`Geocoder <plugins/geocoder>`
- A clean and extensible control for both geocoding and reverse geocoding using different geocoding providers.
* - :doc:`Geoman <plugins/geoman>`
- Interactive drawing and editing interface for polygons, polylines, circles, and other geometric shapes.
* - :doc:`Grouped Layer Control <plugins/grouped_layer_control>`
- Create layer control with support for grouping overlays together.
* - :doc:`Heatmap <plugins/heatmap>`
Expand Down
58 changes: 58 additions & 0 deletions docs/user_guide/plugins/geoman.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Geoman

The Geoman plugin provides an interactive drawing and editing interface for polygons, polylines, circles, and other geometric shapes on your Folium map. It's based on the [Leaflet-Geoman](https://github.com/geoman-io/leaflet-geoman/) library.

## Advantages over Draw Plugin

Geoman is a more recent and actively maintained alternative to the Draw plugin, offering several key advantages:

- **Advanced Shape Features**: Supports drawing shapes with holes inside them, which is not available in the Draw plugin
- **Enhanced Editing Capabilities**: Includes cutting, rotating, scaling, and snapping functionality for precise geometry editing
- **Professional Add-ons**: Offers [paid extensions](https://geoman.io/docs/leaflet/getting-started/pro-version) with advanced functionality for complex GIS applications

## Basic Usage

```{code-cell} ipython3
import folium
from folium.plugins import GeoMan

# Create a map
m = folium.Map(location=[45.5236, -122.6750], zoom_start=13)

# Add Geoman plugin
GeoMan().add_to(m)

m
```

## Customizing Controls

You can customize which drawing controls are available and their position:

```{code-cell} ipython3
import folium
from folium.plugins import GeoMan

m = folium.Map(location=[45.5236, -122.6750], zoom_start=13)

# Add Geoman with custom options
GeoMan(
position='topright',
drawMarker=True,
drawCircleMarker=True,
drawPolyline=True,
drawRectangle=True,
drawPolygon=True,
drawCircle=True,
drawText=False,
editMode=True,
dragMode=True,
cutPolygon=True,
removalMode=True,
rotateMode=False
).add_to(m)

m
```

For more advanced usage and configuration options, refer to the [Leaflet-Geoman documentation](https://geoman.io/docs/leaflet).