Global

Members

Callback Object

A callback object for longdo.PanoramaViewer.
Properties:
Name Type Description
onViewChange function function(head,tilt) called when view point of panorama view is changed.
onPositionChange function function(lat, lon, head, frameTime, frameName) called when panorama location is changed.
onPathChange function function(road, frameNo) called when panorama view has moved to a new path.
onZoomChange function function(zoom) called when zoom level is changed.
onImageStateChange function function(state) called when incoming images state has changed. Image's state is either longdo.PanoramaViewer.IMAGE_STATE_START, longdo.PanoramaViewer.IMAGE_STATE_LOADING or longdo.PanoramaViewer.IMAGE_STATE_DONE.
onChangeMode function function(currentMode, newMode) called when current mode is changed, for example longdo.PanoramaViewer.MODE_MEASURE_POINT and longdo.PanoramaViewer.MODE_DEFAULT.
onMessage function function(message, data) called when there is a new message from API, for example when laser measurement result is ready.
onLengthChange function function(totalLength, lengthAdded) called when API receive a new path from server.
onPlayPause function function(isPlaying) called when API start/stop playing video.
onFullscreen function function(isInFullscreen) called when API enters/leaves full screen mode.
onOverlayClick function function(e) called when any overlay created by API is clicked.
onDropPoint function function(loc) called when location is changed by using the drag & drop tool.
onScreenshot function function(imageDataUrl) called when API finish taking a screenshot of current scene via getScreenshot() method.

Location Object

API usually return or takes a location object as a return value or parameter of a method, for example longdo.PanoramaViewer#location takes a location object and move to that given location. This location object contains three values that can determine absolute location on the Earth.
Properties:
Name Type Description
lat float Latitude
lon float Longitude
z float Altitude (height)

Option Object

Option when initializing longdo.PanoramaViewer.
Properties:
Name Type Description
placeholder String An ID of DOM element to place a panorama view at (required).
map Object A Longdo Map object that will be working in-sync with this panorama view. (default: null)
showPath Boolean Whether paths that represent available panorama lines should be drawn on map. (default: false)
getLength Boolean Normally API will only download paths data from server if 'showPath' option is set to true. However, this option will force API to download path data to calculate the length (and call a callback function 'onLengthChange'), but these path will not be drawn on the map unless 'showPath' option is set to true. (default: false)
showPathDetail Boolean Whether paths' detail should also be drawn on the map. Detail of a path are all image shooting locations, start point and end point of the path. (default: false)
location Object A start point. (default is a location of Longdo Office, Thailand)
tilt Float Initial tilt. Tilt control y-axis of view point (rotate around x-axis). (default: 0)
rhead Float Initial relative head. Relative head is a value indicating direction of a view point compare to the original shooting direction. This is not the same as Azimuth where direction is compared with absolute North. (default: 0)
fixDirection boolean Whether the direct of view point should be fixed to Azimuth of previous frame. (default: false)
messageBox boolean Allow API to show message box. (default: true)
debug Boolean Enable/disable debug mode. (default: false)
callBack Object A callback object contains functions which will be called when certain action happens. (default: null)
sphere boolean Whether source image is a sphere image or cube image. (default: null)
seekStep Number Meter per one seek operation. (default: 5)
seekPlayStep Number Meter per one seek operation when playing video. (default: null)
server String Panorama image server url. (default: //pano.longdo.com)
wsURL String Web service url (default: server option + /ws)
roadPathURL String Web service url to query information about road paths. (default: server option + /ws)
imageURL String Web service url to download panorama image. (default: server option + /img)
imageHDURL String Web service url to download panorama HD image. (default: server option + /imghd)
isHD boolean Whether image server support HD image. This option can be set to true only when API is working with cube image server. (default: false)
autoStart boolean Whether API should automatically start showing a panorama image after initialization process. If this option is set to false, API will only download and draw paths on the map (if 'showPath' is set to true) waiting to be started by longdo.PanoramaViewer#start (default: true)
lang String Language, can be either longdo.PanoramaViewer.LANGUAGE.TH or longdo.PanoramaViewer.LANGUAGE.EN (default: "TH")
mmsLayer Object A Longdo Map layer which will be added to the map. (default: null)
forceWebgl1 boolean Force using Web GL version 1. (default: false)
loadingUi boolean Show API loading UI. (default: true)
panoControlUi boolean Show API control UI. (default: true)
panoWidgetUi boolean Show API widget UI. (default: true)
panoRenderUi boolean Show API rendering UI. (default: true)
panoDirectionUi boolean Show direction indicator on the scene. (default: true)
hasLaser boolean Whether API should work with point cloud laser. In order to work with point cloud laser, server side must support it as well. *Normally, this option should not be set manually. Server configuration will automatically tells client API to enable or disable this option. (default: false)
alwaysDrawLaserUsingUV boolean Should laser points be drawn using UV even they has lat, lon coordinate associate with them (default: false).
measureLineVerticalAngle boolean Whether to show a temporary line while aiming for a new point and print out z angle.
showSurveyPath boolean Whether to show or hide survey path.

Pin Option Object

A callback object for longdo.PanoramaViewer.Pin.
Properties:
Name Type Description
url string A URL for pin's icon.
offset Object An object contains offset data, for example {x:0, y:0}
label string A label associates with this pin.

Methods

HVtoXYZ(h, v, r)

Sphere u,v to OpenGL x,y,z
Parameters:
Name Type Description
h float
v float
r float Default 100

locationToHVR()

Find u,v of specific location in lat, lon, alt by using yaw, pitch, roll