12
12
13
13
# --- Base layer
14
14
class Layer (OLBaseModel ):
15
+ """A base class for creating OL layers"""
15
16
id : str | None = None
16
17
source : dict | SourceT
17
18
background : str | None = None
@@ -31,10 +32,8 @@ def validate_id(cls, v) -> str:
31
32
class TileLayer (Layer ): ...
32
33
33
34
34
- # TODO: Inherit from `VectorTileLayer`
35
- class VectorLayer (Layer ):
35
+ class VectorTileLayer (Layer ):
36
36
style : dict | FlatStyle | None = default_style ()
37
- fit_bounds : bool = Field (False , serialization_alias = "fitBounds" )
38
37
39
38
@field_validator ("style" )
40
39
def validate_style (cls , v ):
@@ -43,19 +42,24 @@ def validate_style(cls, v):
43
42
44
43
return v
45
44
45
+ # TODO: Inherit from `VectorTileLayer`
46
+ class VectorLayer (VectorTileLayer ):
47
+ """A layer for rendering vector sources"""
48
+ #style: dict | FlatStyle | None = default_style()
49
+ fit_bounds : bool = Field (False , serialization_alias = "fitBounds" )
46
50
47
- class WebGLVectorLayer (VectorLayer ): ...
48
-
49
-
50
- class VectorTileLayer (Layer ):
51
- style : dict | FlatStyle | None = None
52
-
51
+ """
53
52
@field_validator("style")
54
53
def validate_style(cls, v):
55
54
if isinstance(v, FlatStyle):
56
55
return v.model_dump()
57
56
58
57
return v
58
+ """
59
+
60
+ class WebGLVectorLayer (VectorLayer ):
61
+ """A layer for rendering vector sources using WebGL"""
62
+ ...
59
63
60
64
61
65
class WebGLVectorTileLayer (VectorTileLayer ): ...
0 commit comments