data overlays
This commit is contained in:
parent
60de7857d6
commit
7904a95b80
22 changed files with 1230 additions and 219 deletions
|
@ -4,7 +4,7 @@ from pydantic import Discriminator
|
|||
from pydantic import Field as APIField
|
||||
from pydantic import NonNegativeFloat, PositiveFloat, PositiveInt
|
||||
|
||||
from c3nav.api.schema import BaseSchema, GeometrySchema, PointSchema
|
||||
from c3nav.api.schema import BaseSchema, GeometrySchema, PointSchema, AnyGeometrySchema
|
||||
from c3nav.api.utils import NonEmptyStr
|
||||
from c3nav.mapdata.models import LocationGroup
|
||||
from c3nav.mapdata.schemas.model_base import (AnyLocationID, AnyPositionID, CustomLocationID, DjangoModelSchema,
|
||||
|
@ -318,6 +318,27 @@ class DynamicLocationSchema(SpecificLocationSchema, DjangoModelSchema):
|
|||
pass
|
||||
|
||||
|
||||
class DataOverlaySchema(TitledSchema, DjangoModelSchema):
|
||||
# TODO
|
||||
pass
|
||||
|
||||
|
||||
class DataOverlayFeatureSchema(TitledSchema, DjangoModelSchema):
|
||||
geometry: AnyGeometrySchema
|
||||
level_id: PositiveInt
|
||||
stroke_color: Optional[str]
|
||||
stroke_width: Optional[float]
|
||||
fill_color: Optional[str]
|
||||
show_label: bool
|
||||
show_geometry: bool
|
||||
interactive: bool
|
||||
point_icon: Optional[str]
|
||||
external_url: Optional[str]
|
||||
extra_data: Optional[dict[str, str]]
|
||||
# TODO
|
||||
pass
|
||||
|
||||
|
||||
class SourceSchema(WithAccessRestrictionSchema, DjangoModelSchema):
|
||||
"""
|
||||
A source image that can be traced in the editor.
|
||||
|
@ -653,7 +674,6 @@ SlimLocationSchema = Annotated[
|
|||
Discriminator("locationtype"),
|
||||
]
|
||||
|
||||
|
||||
listable_location_definitions = schema_definitions(
|
||||
(LevelSchema, SpaceSchema, AreaSchema, POISchema, DynamicLocationSchema, LocationGroupSchema)
|
||||
)
|
||||
|
@ -848,4 +868,4 @@ class LegendItemSchema(BaseSchema):
|
|||
class LegendSchema(BaseSchema):
|
||||
base: list[LegendItemSchema]
|
||||
groups: list[LegendItemSchema]
|
||||
obstacles: list[LegendItemSchema]
|
||||
obstacles: list[LegendItemSchema]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue