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.

Name
Type
Description

from

Camera position (longitude, latitude, altitude).

to

Position the camera is looking at (longitude, latitude, altitude).

MapRender()

Refreshes the map rendering screen.

move(position, tilt, direct, speed)

Moves the camera to a desired location and sets Tilt, Direct.

Name
Type
Description

position

Camera location coordinates (longitude, latitude, altitude).

tilt

number

Camera tilt.

direct

number

Camera direct.

speed

number

Camera speed.

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.

Name
Type
Description

location

Camera location coordinates (longitude, latitude, altitude).

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.

Name
Type
Description

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.

Name
Type
Description

x

number

Camera longitude.

y

number

Camera latitude.

z

number

Camera altitude.

type

boolean

Apply camera movement animation.

moveLonLatAltOval(longitude, latitude, altitude, speed)

Moves the camera to a specified altitude, latitude, and longitude with zoom in/out animation during movement.

Name
Type
Description

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.

Name
Type
Description

option

Camera min, max boundary.

  • Return

    • true : Success.

    • false : Failure.

    • Failure conditions

      • If the complete tag is missing.

  • Sample

moveLonLatOval(longitude, latitude, speed)

Moves the camera to a specified latitude and longitude with zoom in/out animation during movement.

Name
Type
Description

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.

Name
Type
Description

position

Camera location coordinates (longitude, latitude, altitude).

tilt

number

Camera tilt.

direct

number

Camera direct.

speed

number

Camera speed.

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.

Name
Type
Description

location

Camera location coordinates (longitude, latitude, altitude).

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.

Name
Type
Description

pause

boolean

Auto movement setting. True: Pause. False: Resume.

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.

Name
Type
Description

Dist

number

Setting distance(in meters).

setAltitude(alt)

Sets the camera's altitude.

Name
Type
Description

alt

number

Camera altitude.

setAutoMovePosition(coordinates) → boolean

Sets the list of coordinates for the camera's automatic movement.

Name
Type
Description

coordinates

List of coordinates for the path of automatic movement.

  • Return

    • true : Success.

    • false : Failure.

      • If the engine is not properly loaded.

  • Sample

setAutoMoveWaitFrame(speed) → boolean

Sets the number of frames to update the camera's position during automatic movement.

Name
Type
Description

speed

number

Number of frames for updating the camera position.

  • Return

    • true : Success.

    • false : Failure.

      • If the engine is not properly loaded.

  • Sample

setAutoMoveRoundPositions(center, distance, altitude, startAngle, endAngle, type) → boolean

Sets the camera to move in a circular path.

Name
Type
Description

center

The point the camera is looking at (longitude, latitude, altitude)

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)

SetCameraShakeEffect(type) → boolean

Sets the camera shake effect.

Name
Type
Description

type

boolean

Camera shake effect setting.

  • Return

    • true : Success.

    • false : Failure.

      • If the engine is not properly loaded.

  • Sample

SetCameraShakeStrength(value) → boolean

Sets the strength of the camera shake effect.

Name
Type
Description

value

number

Camera shake effect strength (1 ~ 100).

  • Return

    • true : Success.

    • false : Failure.

      • If the engine is not properly loaded.

  • Sample

setPermitUnderGround(type)

Allows or disallows camera movement below the ground.

Name
Type
Description

type

boolean

Permit camera movement below the ground.

startAutoMove() → boolean

Starts the camera's automatic movement.

stopAutoMove() → boolean

Stops the camera's automatic movement.

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.

Name
Type
Description

position

Camera location coordinates (longitude, latitude, altitude).

Getter / Setter

getAnimationSpeed(), setAnimationSpeed(speed) -> number

Sets the speed of the camera movement animation.

Name
Type
Description

speed

number

Camera movement speed (between 1.0 and 10.0).

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

Name
Type
Description

direct

number

Camera direct.

  • Return

    • number: The current camera angle's direction angle in degrees.

  • Sample

getFov(), setFov(fov) -> number

Sets the camera's FOV.

Name
Type
Description

fov

number

Camera fov.

getMoveMode(), setMoveMode(type) -> boolean

Returns the camera's rotation mode.

Name
Type
Description

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

getLimitAltitude(), setLimitAltitude(alt) -> number

Sets the minimum altitude limit for the camera.

Name
Type
Description

alt

number

altitude limit (in meters).

  • Return

    • number: The current minimum altitude limit of the camera in meters.

  • Sample

getLimitTilt(), setLimitTilt(tilt) -> number

Sets the camera's tilt angle limit.

Name
Type
Description

tilt

number

Desired tilt angle limit.

getTilt(), setTilt(tilt) -> number

Returns the camera's current tilt.

Name
Type
Description

tilt

number

Camera tilt.

  • Return

    • number: The current tilt value of the camera in degrees.

  • Sample

Type Definitions

JSCamera.MoveBoundaryOption

Options for moving the camera based on area information.

Name
Type
Attributes
Default
Description

boundary

Camera movement position.

complete

function

Event function after movement completion.

Last updated