map settings api endpoint (fixes #201)
This commit is contained in:
parent
35a8738424
commit
d254f199e3
4 changed files with 66 additions and 9 deletions
|
@ -1,12 +1,36 @@
|
|||
from typing import Annotated, Union
|
||||
from typing import Annotated, Union, Optional
|
||||
|
||||
from pydantic import Field as APIField
|
||||
from pydantic import PositiveInt
|
||||
|
||||
from c3nav.api.schema import BaseSchema, GeometrySchema
|
||||
from c3nav.mapdata.grid import GridSchema
|
||||
from c3nav.mapdata.schemas.model_base import AnyLocationID, BoundsSchema
|
||||
|
||||
|
||||
class MapSettingsSchema(BaseSchema):
|
||||
"""
|
||||
various c3nav instance settings
|
||||
"""
|
||||
initial_bounds: Optional[BoundsSchema] = APIField(
|
||||
title="initial boundaries",
|
||||
description="(left, bottom) to (top, right)",
|
||||
)
|
||||
initial_level: Optional[PositiveInt] = APIField(
|
||||
title="initial level id",
|
||||
description="the level id that is intially shown when opening the map",
|
||||
)
|
||||
|
||||
grid: Optional[GridSchema] = APIField(
|
||||
title="grid config",
|
||||
description="grid configuration, if available",
|
||||
)
|
||||
tile_server: Optional[str] = APIField(
|
||||
title="tile server base URL",
|
||||
description="tile server base URL to use, if configured",
|
||||
)
|
||||
|
||||
|
||||
class WithBoundsSchema(BaseSchema):
|
||||
"""
|
||||
Describing a bounding box
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue