Browse Source

When linking between panorama, orient in the right direction

Baptiste Jonglez 9 years ago
parent
commit
1f15057163
2 changed files with 4 additions and 2 deletions
  1. 4 1
      panorama/models.py
  2. 0 1
      panorama/static/panorama/js/pano.js

+ 4 - 1
panorama/models.py

@@ -175,7 +175,10 @@ class Panorama(ReferencePoint):
         def get_url(refpoint):
         def get_url(refpoint):
             """If the refpoint is also a panorama, returns its canonical URL"""
             """If the refpoint is also a panorama, returns its canonical URL"""
             if hasattr(refpoint, "panorama"):
             if hasattr(refpoint, "panorama"):
-                return refpoint.panorama.get_absolute_url()
+                # Point towards the current panorama
+                end_url = "#zoom=0/cap={}/ele={}".format(refpoint.bearing(self),
+                                                         refpoint.elevation(self))
+                return refpoint.panorama.get_absolute_url() + end_url
             else:
             else:
                 return ""
                 return ""
 
 

+ 0 - 1
panorama/static/panorama/js/pano.js

@@ -622,7 +622,6 @@ function tzoom(zv) {
 
 
 		    } else if(is_visible) {
 		    } else if(is_visible) {
 			    typ = 'pano_point';
 			    typ = 'pano_point';
-			    lnk += '?to_zoom='+this.value;
 		    }
 		    }
 		    this.pt_list[i]['type'] = typ;
 		    this.pt_list[i]['type'] = typ;
 		    this.pt_list[i]['cap'] = cap;
 		    this.pt_list[i]['cap'] = cap;