This is documentation of an archived release.
For documentation on the current version, please check Knowledge Base.

WebClientPanorama → PanoramaViewer

PanoramaViewer

The PanoramaViewer Class models an individual panorama photo viewer.

Managing the Photo

These functions can be used to manage the visible photo :

Function Name Since Arguments Return Type Description
loadPhotoAtXY 10.4.0 x : <float>
y : <float>
crs : <string>
options : <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 : <float>
lon : <float>
options : <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 : <panoramaphoto>
options : <options>
void Load a new photo.
loadPhotoById 10.5.2 photoId : <string>
options : <options>
void Load a new photo with a specific identifier.
getPhoto 10.4.0 <panoramaphoto> Get the currently loaded photo object.

Change Viewer Angles

These functions can be used to get or set any of the viewer angles.

getPan 10.4.0 <float> Get the pan/heading angle.
getTilt 10.4.0 <float> Get the tilt angle.
getFOV 10.4.0 <float> Get the field-of-view (horizontal).
setPan 10.4.0 value : <float> void Set the pan/heading angle.
setTilt 10.4.0 value : <float> void Set the tilt angle.
setFOV 10.4.0 value : <float> void Set the field-of-view (horizontal).

Managing Snapshots

getSnapshot 10.4.1 <string> 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.

lookAtXY 10.5.2 x : <float>
y : <float>
crs : <string>
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 : <float>
y : <float>
z : <float>
crs : <string>
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 :

Event Name Since Event Properties Description
panoramaViewerPhotoChanged 10.4.0 viewerId : <string>
panoramaPhoto : <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 : <string>
pan : <float>
tilt : <float>
fov : <float>
Fired when the projection angles in the viewer have changed.
The new angles are stored in the event properties.
panoramaViewerSnapshotUpdated 10.5.2 viewerId : <string> 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.
 
Last modified:: 2019/03/25 11:36