Skip to content

Commit d1b1460

Browse files
elliot-100Conengmo
andauthored
Docs: utilities.image_to_url() 'image' and related docstrings (#2106)
* Docs: Fix #2905 `utilities.image_to_url()` image parameter documentation issues * improve docs output --------- Co-authored-by: Frank <[email protected]>
1 parent 1432232 commit d1b1460

File tree

3 files changed

+25
-20
lines changed

3 files changed

+25
-20
lines changed

folium/features.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,14 +1862,14 @@ class CustomIcon(Icon):
18621862
18631863
Parameters
18641864
----------
1865-
icon_image : string, file or array-like object
1866-
The data you want to use as an icon.
1867-
* If string, it will be written directly in the output file.
1868-
* If file, it's content will be converted as embedded in the
1869-
output file.
1870-
* If array-like, it will be converted to PNG base64 string
1871-
and embedded in the output.
1872-
1865+
icon_image : string or array-like object
1866+
The data to use as an icon.
1867+
1868+
* If string is a path to an image file, its content will be converted and
1869+
embedded.
1870+
* If string is a URL, it will be linked.
1871+
* Otherwise a string will be assumed to be JSON and embedded.
1872+
* If array-like, it will be converted to PNG base64 string and embedded.
18731873
icon_size : tuple of 2 int, optional
18741874
Size of the icon image in pixels.
18751875
icon_anchor : tuple of 2 int, optional

folium/raster_layers.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,17 @@ class ImageOverlay(Layer):
243243
244244
Parameters
245245
----------
246-
image: string, file or array-like object
247-
The data you want to draw on the map.
248-
* If string, it will be written directly in the output file.
249-
* If file, it's content will be converted as embedded in the output file.
250-
* If array-like, it will be converted to PNG base64 string and embedded in the output.
246+
image: string or array-like object
247+
The data to overlay as an image.
248+
249+
* If string is a path to an image file, its content will be converted and
250+
embedded.
251+
* If string is a URL, it will be linked.
252+
* Otherwise a string will be assumed to be JSON and embedded.
253+
* If array-like, it will be converted to PNG base64 string and embedded.
251254
bounds: list/tuple of list/tuple of float
252255
Image bounds on the map in the form
253-
[[lat_min, lon_min], [lat_max, lon_max]]
256+
[[lat_min, lon_min], [lat_max, lon_max]]
254257
opacity: float, default Leaflet's default (1.0)
255258
alt: string, default Leaflet's default ('')
256259
origin: ['upper' | 'lower'], optional, default 'upper'

folium/utilities.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,14 @@ def image_to_url(
169169
170170
Parameters
171171
----------
172-
image: string, file or array-like object
173-
* If string, it will be written directly in the output file.
174-
* If file, it's content will be converted as embedded in the
175-
output file.
176-
* If array-like, it will be converted to PNG base64 string and
177-
embedded in the output.
172+
image: string or array-like object
173+
* If string is a path to an image file, its content will be converted and
174+
embedded in the output URL.
175+
* If string is a URL, it will be linked in the output URL.
176+
* Otherwise a string will be assumed to be JSON and embedded in the
177+
output URL.
178+
* If array-like, it will be converted to PNG base64 string and embedded in the
179+
output URL.
178180
origin: ['upper' | 'lower'], optional, default 'upper'
179181
Place the [0, 0] index of the array in the upper left or
180182
lower left corner of the axes.

0 commit comments

Comments
 (0)