fix editor bounds when no sources area accessible for the user
This commit is contained in:
parent
1a8c62956d
commit
0393a72c91
2 changed files with 16 additions and 14 deletions
|
@ -9,7 +9,7 @@ from rest_framework.viewsets import ReadOnlyModelViewSet, ViewSet
|
|||
from shapely.ops import cascaded_union
|
||||
|
||||
from c3nav.editor.models import ChangeSet
|
||||
from c3nav.mapdata.models import Area
|
||||
from c3nav.mapdata.models import Area, Source
|
||||
from c3nav.mapdata.models.geometry.space import POI
|
||||
|
||||
|
||||
|
@ -173,6 +173,12 @@ class EditorViewSet(ViewSet):
|
|||
'shadow': '#000000',
|
||||
})
|
||||
|
||||
@list_route(methods=['get'])
|
||||
def bounds(self, request, *args, **kwargs):
|
||||
return Response({
|
||||
'bounds': Source.max_bounds(),
|
||||
})
|
||||
|
||||
|
||||
class ChangeSetViewSet(ReadOnlyModelViewSet):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue