Skip to content

Commit 67f4021

Browse files
committed
Add QML style to geojson layer messages
1 parent 4a805fc commit 67f4021

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

gischat/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ class GischatGeojsonLayerMessage(GischatMessageModel):
115115
crs_wkt: str = CRS_WKT_FIELD
116116
crs_authid: str = CRS_AUTHID_FIELD
117117
geojson: dict = Field(description="Geo data as geojson")
118+
style: Optional[str] = Field(
119+
default=None, description="QML style of the layer (AllStyleCategories)"
120+
)
118121

119122

120123
class GischatCrsMessage(GischatMessageModel):

tests/test_geojson.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def test_send_and_receive_geojson(client: TestClient, room: str):
2828
"crs_wkt": WGS84_WKT,
2929
"crs_authid": WGS84_AUTHID,
3030
"geojson": json.load(file),
31+
"style": "<xml>Some QML style</xml>",
3132
}
3233
)
3334
data = websocket.receive_json()
@@ -38,6 +39,7 @@ def test_send_and_receive_geojson(client: TestClient, room: str):
3839
assert data["crs_wkt"] == WGS84_WKT
3940
assert data["crs_authid"] == WGS84_AUTHID
4041
assert data["geojson"]["type"] == "FeatureCollection"
42+
assert data["style"] == "<xml>Some QML style</xml>"
4143
assert len(data["geojson"]["features"]) == 60
4244

4345

0 commit comments

Comments
 (0)