stair shadows in editor
This commit is contained in:
parent
7f2ce5dd55
commit
4eeea73af8
1 changed files with 6 additions and 2 deletions
|
@ -72,10 +72,13 @@ class EditorViewSet(ViewSet):
|
|||
space.lineobstacles.all(),
|
||||
space.points.all(),
|
||||
)
|
||||
return Response([obj.to_geojson() for obj in results])
|
||||
return Response(sum([self._get_geojsons(obj) for obj in results], ()))
|
||||
else:
|
||||
raise ValidationError('No section or space specified.')
|
||||
|
||||
def _get_geojsons(self, obj):
|
||||
return ((obj.to_shadow_geojson(),) if hasattr(obj, 'to_shadow_geojson') else ()) + (obj.to_geojson(),)
|
||||
|
||||
@list_route(methods=['get'])
|
||||
def geometrystyles(self, request, *args, **kwargs):
|
||||
return Response({
|
||||
|
@ -84,8 +87,9 @@ class EditorViewSet(ViewSet):
|
|||
'hole': 'rgba(255, 0, 0, 0.3)',
|
||||
'door': '#ffffff',
|
||||
'area': '#55aaff',
|
||||
'stair': '#990099',
|
||||
'stair': 'rgba(160, 0, 160, 0.5)',
|
||||
'obstacle': '#999999',
|
||||
'lineobstacle': '#999999',
|
||||
'point': '#4488cc',
|
||||
'shadow': '#000000',
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue