Browse Source

view: In the minimap, only display panoramas that are not too far away

Baptiste Jonglez 8 years ago
parent
commit
71da6eeb87
1 changed files with 2 additions and 1 deletions
  1. 2 1
      panorama/views.py

+ 2 - 1
panorama/views.py

@@ -43,7 +43,8 @@ class PanoramaView(CelutzLoginMixin, DetailView):
 
 
     def get_context_data(self, **kwargs):
     def get_context_data(self, **kwargs):
         context = super(PanoramaView, self).get_context_data(**kwargs)
         context = super(PanoramaView, self).get_context_data(**kwargs)
-        context['panoramas'] = Panorama.objects.all()
+        pano = context['panorama']
+        context['panoramas'] = [p for p in Panorama.objects.all() if pano.great_circle_distance(p) <= settings.PANORAMA_MAX_DISTANCE]
         return context
         return context