Parcourir la source

A panorama cannot see a point that is too far away

Baptiste Jonglez il y a 9 ans
Parent
commit
fcdcd79569
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      panorama/models.py

+ 2 - 0
panorama/models.py

@@ -215,6 +215,8 @@ class Panorama(ReferencePoint):
 
     def is_visible(self, point):
         """Return True if the Panorama can see the point."""
+        if self.great_circle_distance(point) > settings.PANORAMA_MAX_DISTANCE:
+            return False
         if self.loop:
             return True
         cap = self.bearing(point) % 360