add support for intermediate levels
This commit is contained in:
parent
834d6f0064
commit
a1ed7534d9
8 changed files with 213 additions and 67 deletions
|
@ -95,7 +95,7 @@ class GeometryMapItemWithLevel(GeometryMapItem):
|
|||
|
||||
def get_geojson_properties(self):
|
||||
result = super().get_geojson_properties()
|
||||
result['level'] = float(self.level.name)
|
||||
result['level'] = self.level.name
|
||||
return result
|
||||
|
||||
def tofile(self):
|
||||
|
@ -105,6 +105,42 @@ class GeometryMapItemWithLevel(GeometryMapItem):
|
|||
return result
|
||||
|
||||
|
||||
class Building(GeometryMapItemWithLevel):
|
||||
"""
|
||||
The outline of a building on a specific level
|
||||
"""
|
||||
geomtype = 'polygon'
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('Building')
|
||||
verbose_name_plural = _('Buildings')
|
||||
default_related_name = 'buildings'
|
||||
|
||||
|
||||
class Room(GeometryMapItemWithLevel):
|
||||
"""
|
||||
An accessible area like a room. Can overlap.
|
||||
"""
|
||||
geomtype = 'polygon'
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('Room')
|
||||
verbose_name_plural = _('Rooms')
|
||||
default_related_name = 'rooms'
|
||||
|
||||
|
||||
class Outside(GeometryMapItemWithLevel):
|
||||
"""
|
||||
An accessible outdoor area like a court. Can overlap.
|
||||
"""
|
||||
geomtype = 'polygon'
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('Outside Area')
|
||||
verbose_name_plural = _('Outside Areas')
|
||||
default_related_name = 'outsides'
|
||||
|
||||
|
||||
class LevelConnector(GeometryMapItem):
|
||||
"""
|
||||
A connector connecting levels
|
||||
|
@ -144,42 +180,6 @@ class LevelConnector(GeometryMapItem):
|
|||
return result
|
||||
|
||||
|
||||
class Building(GeometryMapItemWithLevel):
|
||||
"""
|
||||
The outline of a building on a specific level
|
||||
"""
|
||||
geomtype = 'polygon'
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('Building')
|
||||
verbose_name_plural = _('Buildings')
|
||||
default_related_name = 'buildings'
|
||||
|
||||
|
||||
class Room(GeometryMapItemWithLevel):
|
||||
"""
|
||||
An accessible area like a room. Can overlap.
|
||||
"""
|
||||
geomtype = 'polygon'
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('Room')
|
||||
verbose_name_plural = _('Rooms')
|
||||
default_related_name = 'rooms'
|
||||
|
||||
|
||||
class Outside(GeometryMapItemWithLevel):
|
||||
"""
|
||||
An accessible outdoor area like a court. Can overlap.
|
||||
"""
|
||||
geomtype = 'polygon'
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('Outside Area')
|
||||
verbose_name_plural = _('Outside Areas')
|
||||
default_related_name = 'outsides'
|
||||
|
||||
|
||||
class Obstacle(GeometryMapItemWithLevel):
|
||||
"""
|
||||
An obstacle
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue