Skip to content

Commit b562e11

Browse files
committed
Add docstrings
1 parent ab78cb9 commit b562e11

File tree

14 files changed

+98
-11
lines changed

14 files changed

+98
-11
lines changed

docs/api/basemaps.md

Whitespace-only changes.

docs/api/controls.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Controls
2+
3+
::: openlayers.controls

docs/api/express.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# OpenLayersExpress
2+
3+
::: openlayers.express.GeoJSONLayer

docs/api/geopandas.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# GeoPandas
2+
3+
::: openlayers.geopandas.OLAccessor
4+
5+
::: openlayers.geopandas.GeoDataFrame

docs/api/layers.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Layers
2+
3+
::: openlayers.models.layers
4+

docs/api/map.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Map
2+
3+
::: openlayers.map.Map
4+
5+
::: openlayers.anywidget.MapWidget

docs/api/styles.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Styles
2+
3+
::: openlayers.styles.FlatStyle

mkdocs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,12 @@ markdown_extensions:
3434
nav:
3535
- Get started: index.md
3636
# - Concepts: concept.md
37+
- API documentation:
38+
- Map: api/map.md
39+
- Controls: api/controls.md
40+
- Layers: api/layers.md
41+
- Styles: api/styles.md
42+
- Basemaps: api/basemaps.md
43+
- GeoPandas: api/geopandas.md
44+
- Express: api/express.md
3745
- Changelog: changelog.md

src/openlayers/__future__/__init__.py

Whitespace-only changes.

src/openlayers/express.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@
99

1010

1111
class GeoJSONLayer(LayerLike):
12+
"""Initialize a new `GeoJSONLayer` instance
13+
14+
Args:
15+
data (str | dict): Either an URL to a GeoJSON object
16+
or a dictionary representing a GeoJSON object
17+
id (str): The ID of the layer. If `None`, a random ID is generated
18+
style (FlatStyle): The style to be applied to the layer. If `None` a default style is used
19+
**kwargs (Any): Style arguments that are appended to the `Style` object.
20+
Latter ones overwrite existing entries
21+
"""
22+
1223
def __init__(
1324
self,
1425
data: str | dict,
@@ -35,6 +46,14 @@ def model(self) -> WebGLVectorLayer | VectorLayer:
3546
def to_map(
3647
self, lon: float = 0, lat: float = 0, zoom: float | int = 0, **kwargs
3748
) -> Map:
49+
"""Initialize a new `Map` instance and add the layer to it
50+
51+
Args:
52+
lon (float): The longitude of the initial view state of the map
53+
lat (float): The latitude of the initial view state of the map
54+
zoom (float | int): The initial zoom level of the map
55+
**kwargs (Any): Arguments that are handed over to the `Map` instance
56+
"""
3857
m = Map(View(center=(lon, lat), zoom=zoom), **kwargs)
3958
m.add_layer(self)
4059
return m

0 commit comments

Comments
 (0)