JSCamera
API for map camera settings.
Create the Module.getViewCamera API.
var camera = Module.getViewCamera();
Function
AltitudeDown()
Lowers the camera's altitude.
AltitudeUp()
Raises the camera's altitude.
AngleDown()
Lowers the camera's tilt angle.
Does not work in planar mode, which does not support rotation.
AngleUp()
Raises the camera's tilt angle.
FOVDecrease()
Decreases the camera's FOV.
FOVIncrease()
Increases the camera's FOV.
getMapZoomLevel() -> number
Returns the camera Zoom Level.
Return
number: The current camera's zoom level
look(from, to) → boolean
Moves the camera using two points, from and to.
Return
true : Success.
false : Failure.
Sample
See function init.
MapRender()
Refreshes the map rendering screen.
move(position, tilt, direct, speed)
Moves the camera to a desired location and sets Tilt, Direct.
tilt
number
Camera tilt.
direct
number
Camera direct.
speed
number
Camera speed.
Sample
See function init.
moveDist(location, tilt, direct, dist, speed)
Moves the camera to a specified latitude and longitude based position, then sets the camera angles (tilt, Direct), distance, and speed.
tilt
number
Tilt to set after moving.
direct
number
Direct to set after moving.
dist
number
Distance to set after moving (currently not applied).
speed
number
Camera movement speed. Speed is an integer greater than 1, with higher values indicating faster movement.
MoveDown()
Moves the camera backward.
MoveLeft()
Moves the camera to the left side.
moveLonLat(longitude, latitude)
Moves the camera to a specified latitude and longitude.
longitude
number
Longitude of the position to move to (in degrees).
latitude
number
Latitude of the position to move to (in degrees).
moveLonLatAlt(x, y, z, type)
Moves the camera to a specified altitude, latitude, and longitude position.
x
number
Camera longitude.
y
number
Camera latitude.
z
number
Camera altitude.
type
boolean
Apply camera movement animation.
Sample
See function init.
moveLonLatAltOval(longitude, latitude, altitude, speed)
Moves the camera to a specified altitude, latitude, and longitude with zoom in/out animation during movement.
longitude
number
Longitude of the position to move to (in degrees).
latitude
number
Latitude of the position to move to (in degrees).
altitude
number
Altitude of the position to move to (in meters).
speed
number
Camera movement speed. Speed is an integer greater than 1, with higher values indicating faster movement.
moveLonLatBoundarybyJson(option) → string
Moves the camera using min, max boundary.
Return
true : Success.
false : Failure.
Failure conditions
If the complete tag is missing.
Sample
See function moveTestArea.
moveLonLatOval(longitude, latitude, speed)
Moves the camera to a specified latitude and longitude with zoom in/out animation during movement.
longitude
number
Longitude of the position to move to (in degrees).
latitude
number
Latitude of the position to move to (in degrees).
speed
number
Camera movement speed. Speed is an integer greater than 1, with higher values indicating faster movement.
moveOval(position, tilt, direct, speed)
Moves the camera to a specified altitude, latitude, and longitude position with animation effect.
tilt
number
Camera tilt.
direct
number
Camera direct.
speed
number
Camera speed.
Sample
See function initPage.
moveOvalDist(location, tilt, Direct, speed)
Moves the camera to a specified latitude and longitude based position, then sets the camera tilt and direction, distance with zoom in/out animation during movement.
tilt
number
Tilt to set after moving.
Direct
number
Direct to set after moving.
speed
number
Camera movement speed. Speed is an integer greater than 1, with higher values indicating faster movement.
MoveRight()
Moves the camera to the right side.
MoveUp()
Moves the camera forward.
pauseAutoMove(pause) -> boolean
Pauses the camera's automatic movement.
pause
boolean
Auto movement setting. True: Pause. False: Resume.
Return
True : Success.
False : Failure.
Sample
See function pauseCameraAutoMove.
reset()
Resets the camera's position and distance properties to their initial state.
rotateLeft()
Rotates the camera to the left side of the view.
rotateRight()
Rotates the camera to the right side of the view.
setDistance(Dist)
Sets the distance between the camera's viewpoint and its position.
Dist
number
Setting distance(in meters).
setAltitude(alt)
Sets the camera's altitude.
alt
number
Camera altitude.
Sample
See function setAltitude.
setAutoMovePosition(coordinates) → boolean
Sets the list of coordinates for the camera's automatic movement.
Return
true : Success.
false : Failure.
If the engine is not properly loaded.
Sample
See function setAutoMovePosition.
setAutoMoveWaitFrame(speed) → boolean
Sets the number of frames to update the camera's position during automatic movement.
speed
number
Number of frames for updating the camera position.
Return
true : Success.
false : Failure.
If the engine is not properly loaded.
Sample
See function setAutoMovePosition.
setAutoMoveRoundPositions(center, distance, altitude, startAngle, endAngle, type) → boolean
Sets the camera to move in a circular path.
distance
number
Distance between the center point and the camera
altitude
number
Camera altitude
startAngle
number
Starting direction
endAngle
number
Ending direction
type
boolean
Direction setting (true: counterclockwise, false: clockwise)
Return
true : Success.
false : Failure.
Sample
See function setAutoMovePosition
SetCameraShakeEffect(type) → boolean
Sets the camera shake effect.
type
boolean
Camera shake effect setting.
Return
true : Success.
false : Failure.
If the engine is not properly loaded.
Sample
See function ShakeCamera.
SetCameraShakeStrength(value) → boolean
Sets the strength of the camera shake effect.
value
number
Camera shake effect strength (1 ~ 100).
Return
true : Success.
false : Failure.
If the engine is not properly loaded.
Sample
See function SetShakeEffectStrength.
setPermitUnderGround(type)
Allows or disallows camera movement below the ground.
type
boolean
Permit camera movement below the ground.
startAutoMove() → boolean
Starts the camera's automatic movement.
Return
true : Success.
false : Failure.
Sample
See function startCameraAutoMove.
stopAutoMove() → boolean
Stops the camera's automatic movement.
Return
true : Success.
false : Failure.
Sample
See function stopCameraAutoMove.
viewNorth()
Rotates the camera to face true north.
ZoomIn()
Zooms in the camera based on the center of the screen.
ZoomOut()
Zooms out the camera based on the center of the screen.
getLocation() -> JSVector3D
Returns the camera's location.
Return
JSVector3D: Returns the location coordinates (longitude, latitude, altitude) of the camera successfully.
null: Coordinate return failed.
setLocation(position) → boolean
Sets the camera's location.
Return
true : Success.
false : Failure.
Sample
See function setMove.
Getter / Setter
getAnimationSpeed(), setAnimationSpeed(speed) -> number
Sets the speed of the camera movement animation.
speed
number
Camera movement speed (between 1.0 and 10.0).
Return
number: The speed of the movement animation.
Sample
See function setEvent.
getDirect(), setDirect(direct) -> number
Returns the current direction angle of the camera.
The direction angle values range between -180 degrees and 180 degrees. The direction the camera faces at each angle is as follows:
0 degrees: North
+90 degrees: East
+180 degrees (=-180 degrees): South
-90 degrees: West
direct
number
Camera direct.
Return
number: The current camera angle's direction angle in degrees.
Sample
See function setDirect.
getFov(), setFov(fov) -> number
Sets the camera's FOV.
fov
number
Camera fov.
Return
number: The current camera FOV angle in degrees.
Sample
See function setFOV.
getMoveMode(), setMoveMode(type) -> boolean
Returns the camera's rotation mode.
type
boolean
Camera viewpoint.
Return
The current camera's rotation mode.
True: First-person rotation mode.
False: Third-person rotation mode.
False: Failure due to engine not being initialized.
Sample
See function setPerson.
getLimitAltitude(), setLimitAltitude(alt) -> number
Sets the minimum altitude limit for the camera.
alt
number
altitude limit (in meters).
Return
number: The current minimum altitude limit of the camera in meters.
Sample
See function initPage.
getLimitTilt(), setLimitTilt(tilt) -> number
Sets the camera's tilt angle limit.
tilt
number
Desired tilt angle limit.
Return
number: The current tilt angle limit of the camera in degrees.
Sample
See function initPage.
getTilt(), setTilt(tilt) -> number
Returns the camera's current tilt.
tilt
number
Camera tilt.
Return
number: The current tilt value of the camera in degrees.
Sample
See function setTilt.
Type Definitions
JSCamera.MoveBoundaryOption
Options for moving the camera based on area information.
complete
function
Event function after movement completion.
Last updated