File tree Expand file tree Collapse file tree 6 files changed +23
-14
lines changed Expand file tree Collapse file tree 6 files changed +23
-14
lines changed Original file line number Diff line number Diff line change
1
+ # Sources
2
+
3
+ ::: openlayers.sources
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ Sources state which data the map should display.
10
10
- 8 < -- " concepts/sources.py"
11
11
```
12
12
13
- > See [ Sources API] ( ../../api/layers / )
13
+ > See [ Sources API] ( ../../api/sources / )
14
14
15
15
## Layers
16
16
Original file line number Diff line number Diff line change 43
43
- Map : api/map.md
44
44
- Controls : api/controls.md
45
45
- Layers : api/layers.md
46
+ - Sources : api/sources.md
46
47
- Styles : api/styles.md
47
48
- Basemaps : api/basemaps.md
48
49
- GeoPandas : api/geopandas.md
Original file line number Diff line number Diff line change @@ -44,22 +44,12 @@ def validate_style(cls, v):
44
44
return v
45
45
46
46
47
- # TODO: Inherit from `VectorTileLayer`
48
47
class VectorLayer (VectorTileLayer ):
49
48
"""A layer for rendering vector sources"""
50
49
51
50
# style: dict | FlatStyle | None = default_style()
52
51
fit_bounds : bool = Field (False , serialization_alias = "fitBounds" )
53
52
54
- """
55
- @field_validator("style")
56
- def validate_style(cls, v):
57
- if isinstance(v, FlatStyle):
58
- return v.model_dump()
59
-
60
- return v
61
- """
62
-
63
53
64
54
class VectorImageLayer (VectorLayer ):
65
55
"""A layer for rendering vector sources
@@ -84,7 +74,11 @@ class WebGLVectorTileLayer(VectorTileLayer): ...
84
74
85
75
86
76
class WebGLTileLayer (Layer ):
87
- # See https://openlayers.org/en/latest/apidoc/module-ol_layer_WebGLTile.html#~Style
77
+ """WebGLTile layer
78
+
79
+ Note:
80
+ See [WebGLTile](https://openlayers.org/en/latest/apidoc/module-ol_layer_WebGLTile.html) for details.
81
+ """
88
82
style : dict | None = None
89
83
90
84
Original file line number Diff line number Diff line change @@ -27,7 +27,12 @@ class OSM(Source):
27
27
28
28
29
29
class GeoTIFFSource (Source ):
30
- """GeoTIFF source"""
30
+ """GeoTIFF source
31
+
32
+ Examples:
33
+ >>> import ol
34
+ >>> geotiff = ol.GeoTIFFSource(sources=[{"url": "https://s2downloads.eox.at/demo/EOxCloudless/2020/rgbnir/s2cloudless2020-16bits_sinlge-file_z0-4.tif"}])
35
+ """
31
36
32
37
normalize : bool | None = None
33
38
sources : list [dict ]
@@ -46,7 +51,7 @@ class VectorTileSource(ImageTileSource):
46
51
"""A source for vector data divided into a tile grid
47
52
48
53
Note:
49
- See [VectorTile](https://openlayers.org/en/latest/apidoc/module-ol_source_VectorTile-VectorTile.html)
54
+ See [VectorTile](https://openlayers.org/en/latest/apidoc/module-ol_source_VectorTile-VectorTile.html) for details.
50
55
"""
51
56
52
57
...
@@ -69,11 +74,15 @@ def type(self) -> str:
69
74
# PMTiles extension
70
75
# See https://docs.protomaps.com/pmtiles/openlayers
71
76
class PMTilesVectorSource (Source ):
77
+ """PMTiles vector source"""
78
+
72
79
url : str
73
80
attributions : list [str ] = None
74
81
75
82
76
83
class PMTilesRasterSource (PMTilesVectorSource ):
84
+ """PMTiles raster source"""
85
+
77
86
tile_size : tuple [int , int ] = Field (None , serialization_alias = "tileSize" )
78
87
79
88
Original file line number Diff line number Diff line change 10
10
VectorTileSource ,
11
11
TileJSONSource ,
12
12
PMTilesVectorSource ,
13
+ PMTilesRasterSource ,
13
14
)
14
15
15
16
__all__ = [
20
21
"VectorTileSource" ,
21
22
"TileJSONSource" ,
22
23
"PMTilesVectorSource" ,
24
+ "PMTilesRasterSource" ,
23
25
]
You can’t perform that action at this time.
0 commit comments