editor: select geometry types to show on map
This commit is contained in:
parent
f0a2f5e058
commit
e69b0a95ec
4 changed files with 85 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
import mimetypes
|
||||
import os
|
||||
from collections import OrderedDict
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.files import File
|
||||
|
@ -13,6 +14,21 @@ from c3nav.mapdata.permissions import filter_queryset_by_package_access
|
|||
from c3nav.mapdata.serializers.main import LevelSerializer, PackageSerializer, SourceSerializer
|
||||
|
||||
|
||||
class GeometryTypeViewSet(ViewSet):
|
||||
"""
|
||||
Lists all geometry types.
|
||||
"""
|
||||
|
||||
def list(self, request):
|
||||
return Response([
|
||||
OrderedDict((
|
||||
('name', name),
|
||||
('title', str(mapitemtype._meta.verbose_name)),
|
||||
('title_plural', str(mapitemtype._meta.verbose_name_plural)),
|
||||
)) for name, mapitemtype in GEOMETRY_MAPITEM_TYPES.items()
|
||||
])
|
||||
|
||||
|
||||
class GeometryViewSet(ViewSet):
|
||||
"""
|
||||
List all geometries.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue