Skip to content

Commit 469bae3

Browse files
Documentation added for Geoman plugin with examples (#2181)
* documentation added for geoman plugin with example
1 parent 60bc0d6 commit 469bae3

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

docs/user_guide/plugins.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Plugins
1313
plugins/float_image
1414
plugins/fullscreen
1515
plugins/geocoder
16+
plugins/geoman
1617
plugins/grouped_layer_control
1718
plugins/heatmap
1819
plugins/heatmap_with_time
@@ -65,6 +66,8 @@ Plugins
6566
- A fullscreen button control for modern browsers, using HTML Fullscreen API.
6667
* - :doc:`Geocoder <plugins/geocoder>`
6768
- A clean and extensible control for both geocoding and reverse geocoding using different geocoding providers.
69+
* - :doc:`Geoman <plugins/geoman>`
70+
- Interactive drawing and editing interface for polygons, polylines, circles, and other geometric shapes.
6871
* - :doc:`Grouped Layer Control <plugins/grouped_layer_control>`
6972
- Create layer control with support for grouping overlays together.
7073
* - :doc:`Heatmap <plugins/heatmap>`

docs/user_guide/plugins/geoman.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Geoman
2+
3+
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.
4+
5+
## Advantages over Draw Plugin
6+
7+
Geoman is a more recent and actively maintained alternative to the Draw plugin, offering several key advantages:
8+
9+
- **Advanced Shape Features**: Supports drawing shapes with holes inside them, which is not available in the Draw plugin
10+
- **Enhanced Editing Capabilities**: Includes cutting, rotating, scaling, and snapping functionality for precise geometry editing
11+
- **Professional Add-ons**: Offers [paid extensions](https://geoman.io/docs/leaflet/getting-started/pro-version) with advanced functionality for complex GIS applications
12+
13+
## Basic Usage
14+
15+
```{code-cell} ipython3
16+
import folium
17+
from folium.plugins import GeoMan
18+
19+
# Create a map
20+
m = folium.Map(location=[45.5236, -122.6750], zoom_start=13)
21+
22+
# Add Geoman plugin
23+
GeoMan().add_to(m)
24+
25+
m
26+
```
27+
28+
## Customizing Controls
29+
30+
You can customize which drawing controls are available and their position:
31+
32+
```{code-cell} ipython3
33+
import folium
34+
from folium.plugins import GeoMan
35+
36+
m = folium.Map(location=[45.5236, -122.6750], zoom_start=13)
37+
38+
# Add Geoman with custom options
39+
GeoMan(
40+
position='topright',
41+
drawMarker=True,
42+
drawCircleMarker=True,
43+
drawPolyline=True,
44+
drawRectangle=True,
45+
drawPolygon=True,
46+
drawCircle=True,
47+
drawText=False,
48+
editMode=True,
49+
dragMode=True,
50+
cutPolygon=True,
51+
removalMode=True,
52+
rotateMode=False
53+
).add_to(m)
54+
55+
m
56+
```
57+
58+
For more advanced usage and configuration options, refer to the [Leaflet-Geoman documentation](https://geoman.io/docs/leaflet).

0 commit comments

Comments
 (0)