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.
1010- 8 < -- " concepts/sources.py"
1111```
1212
13- > See [ Sources API] ( ../../api/layers / )
13+ > See [ Sources API] ( ../../api/sources / )
1414
1515## Layers
1616
Original file line number Diff line number Diff line change 4343 - Map : api/map.md
4444 - Controls : api/controls.md
4545 - Layers : api/layers.md
46+ - Sources : api/sources.md
4647 - Styles : api/styles.md
4748 - Basemaps : api/basemaps.md
4849 - GeoPandas : api/geopandas.md
Original file line number Diff line number Diff line change @@ -44,22 +44,12 @@ def validate_style(cls, v):
4444 return v
4545
4646
47- # TODO: Inherit from `VectorTileLayer`
4847class VectorLayer (VectorTileLayer ):
4948 """A layer for rendering vector sources"""
5049
5150 # style: dict | FlatStyle | None = default_style()
5251 fit_bounds : bool = Field (False , serialization_alias = "fitBounds" )
5352
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-
6353
6454class VectorImageLayer (VectorLayer ):
6555 """A layer for rendering vector sources
@@ -84,7 +74,11 @@ class WebGLVectorTileLayer(VectorTileLayer): ...
8474
8575
8676class 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+ """
8882 style : dict | None = None
8983
9084
Original file line number Diff line number Diff line change @@ -27,7 +27,12 @@ class OSM(Source):
2727
2828
2929class 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+ """
3136
3237 normalize : bool | None = None
3338 sources : list [dict ]
@@ -46,7 +51,7 @@ class VectorTileSource(ImageTileSource):
4651 """A source for vector data divided into a tile grid
4752
4853 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.
5055 """
5156
5257 ...
@@ -69,11 +74,15 @@ def type(self) -> str:
6974# PMTiles extension
7075# See https://docs.protomaps.com/pmtiles/openlayers
7176class PMTilesVectorSource (Source ):
77+ """PMTiles vector source"""
78+
7279 url : str
7380 attributions : list [str ] = None
7481
7582
7683class PMTilesRasterSource (PMTilesVectorSource ):
84+ """PMTiles raster source"""
85+
7786 tile_size : tuple [int , int ] = Field (None , serialization_alias = "tileSize" )
7887
7988
Original file line number Diff line number Diff line change 1010 VectorTileSource ,
1111 TileJSONSource ,
1212 PMTilesVectorSource ,
13+ PMTilesRasterSource ,
1314)
1415
1516__all__ = [
2021 "VectorTileSource" ,
2122 "TileJSONSource" ,
2223 "PMTilesVectorSource" ,
24+ "PMTilesRasterSource" ,
2325]
You can’t perform that action at this time.
0 commit comments