[[global]] -> [[Panorama]] -> PanoramaViewer
====== PanoramaViewer ====== The ''PanoramaViewer'' Class models an individual panorama photo viewer. ===== Managing the Photo ===== These functions can be used to manage the visible photo : |< 100% 20% 7% 20% 10% - >| ^ Function Name ^ Since ^ Arguments ^ Return Type ^ Description ^ | loadPhotoAtXY | 10.4.0 | x : \\ y : \\ crs : [[crs|]]\\ options : [[load_photo_options|]] | void | Load a new photo by searching for the closest photo to a given coordinate.\\ - x,y : The WGS/84 coordinate to search at.\\ - crs : CRS of the search coordinate. | | loadPhotoAtLatLon | 10.4.0 | lat : \\ lon : \\ options : [[load_photo_options|]] | void | Load a new photo by searching for the closest photo to a given coordinate.\\ - lat,lon : The coordinate to search at.\\ - crs : CRS of the search coordinate. | | loadPhoto | 10.4.0 | photo : \\ options : [[load_photo_options|]] | void | Load a new photo. | | loadPhotoById | 10.5.2 | photoId : \\ options : [[load_photo_options|]] | void | Load a new photo with a specific identifier. | | getPhoto | 10.4.0 | | [[core_types|]] | Get the currently loaded photo object. | ===== Change Viewer Angles ===== These functions can be used to get or set any of the viewer angles. |< 100% 20% 7% 20% 10% - >| | getPan | 10.4.0 | | | Get the pan/heading angle. | | getTilt | 10.4.0 | | | Get the tilt angle. | | getFOV | 10.4.0 | | | Get the field-of-view (horizontal). | | setPan | 10.4.0 | value : | void | Set the pan/heading angle. | | setTilt | 10.4.0 | value : | void | Set the tilt angle. | | setFOV | 10.4.0 | value : | void | Set the field-of-view (horizontal). | ===== Managing Snapshots ===== |< 100% 20% 7% 20% 10% - >| | getSnapshot | 10.4.1 | | | Get the panorama snapshot image.\\ Returns a base64-encoded string holding an encoded jpeg image. | | updateSnapshot | 10.4.1 | | void | Updates the snapshot image.\\ Calling this function will generate a snapshot image in the background. After the //panoramaViewerSnapshotUpdated// event has been fired use //getSnapshot()// to retrieve the actual snapshot. | ===== Looking at something ===== Using the functions, you can tell the viewer to look at a specific detail. |< 100% 20% 7% 20% 10% - >| | lookAtXY | 10.5.2 | x : \\ y : \\ crs : [[crs|]] | void | Look in the direction of a specific 2D spatial position.\\ This method adjusts the pan angles and fieldOfView of the panorama.\\ - x,y : The coordinate to look at.\\ - crs : CRS of the provided coordinate.\\ It is best to call this method with a WGS/84 coordinate. Any other CRS will force the component to make a CRS conversion (by making a request to the server). | | lookAtXYZ | 10.5.2 | x : \\ y : \\ z : \\ crs : [[crs|]] | void | Look in the direction of a specific 3D spatial position.\\ This method adjusts the pan, tilt and fieldOfView angles of the panorama.\\ - x,y,z : The coordinate to look at.\\ - crs : CRS of the provided coordinate.\\ It is best to call this method with a WGS/84 coordinate. Any other CRS will force the component to make a CRS conversion (by making a request to the server). | ===== Events ===== The following events can be fired : |< 100% 20% 7% 25% - >| ^ Event Name ^ Since ^ Event Properties ^ Description ^ | panoramaViewerPhotoChanged | 10.4.0 | viewerId : \\ panoramaPhoto : | Fired when the photo in the viewer has changed.\\ The new photoposition object is stored in the panoramaPhoto property. | | panoramaViewerStateChanged | 10.4.0 | viewerId : \\ pan : \\ tilt : \\ fov : | Fired when the projection angles in the viewer have changed.\\ The new angles are stored in the event properties. | | panoramaViewerSnapshotUpdated | 10.5.2 | viewerId : | Fired when the snapshot image of the viewer has changed.\\ The snapshot image can be retrieved by using the getSnapshot() function on the panorama viewer instance. | Deprecated since 10.4.0 : * panoramaViewerPhotoPositionChanged : Use //panoramaViewerPhotoChanged// instead. * panoramaViewerProjectionChanged : Use //panoramaViewerStateChanged// instead. * panoramaViewerProjectionAnglesChanged : Use //panoramaViewerStateChanged// instead.