JSMap

API for map settings and control functions.

Creates the Module.getMap API.

var map = Module.getMap();

Function

addHeatMaps(coordinates)

Sets an array list of heatmap coordinates.

Name
Type
Description

coordinates

List of heatmap coordinates.

addInputPoint(lon, lat) → number

Adds a user input point.

Name
Type
Description

lon

number

Longitude of the input point (in degrees).

lat

number

Latitude of the input point (in degrees).

  • Return

    • number: The cumulative number of input points after API execution.

clearHeatMap()

Initializes the heatmap.

clearInputPoint()

Initializes the list of entered coordinates.

clearSelectObj()

Deselects the object selection state.

clearSnowfallArea()

Initializes the snowfall effect.

getInputPointCount() → number

Returns the current number of input points.

  • Return

    • number(0 or more): The current number of input points.

    • number(-1): If the map has not been initialized.

getInputPointList() → Collection

Returns the list of entered coordinates.

  • Return

    • Collection: Successful return of the list of entered coordinates.

    • null: If there are no entered coordinates

  • Sample

getInputPoints() → JSVec3Array

Returns the list of entered coordinates.

  • Return

    • JSVec3Array: Successful return of the list of entered coordinates.

    • null: If there are no entered coordinates.

  • Sample

getTerrHeight(lon, lat) → number

Returns the terrain height value at the specified location.

Name
Type
Description

lon

number

Longitude.

lat

number

Latitude.

  • Return

    • Terrain height value.

    • 0: If the DEM for the area has not been loaded.

GetPointDistance(from, to, type) → number

Returns the distance between two points.

Name
Type
Description

from

Start point location (longitude, latitude, altitude).

to

End point location (longitude, latitude, altitude).

type

boolean

Whether to consider terrain (false: straight line distance, true: distance considering terrain).

  • Return

    • The distance between two points.

    • 0: If the engine has not been loaded properly.

getLineBuffer(coordinates, distance) → JSVec2Array

Returns the coordinates of a line buffer polygon based on the set distance.

Name
Type
Description

coordinates

List of line coordinates (longitude, latitude).

distance

number

Distance from the line (distance from the line).

  • Return

    • JSVec2Array: Returns a list of latitude and longitude coordinates of the line buffer polygon successfully.

    • null: If the engine has not been loaded properly.

  • Sample

MapRender()

Refreshes the map screen.

MapToScreenPointEX(position) → JSVector2D

Returns screen coordinates for 3D map coordinates.

Name
Type
Description

position

3D map location coordinates (longitude, latitude, altitude).

ScreenToMapPointEX(position) → JSVector3D

Returns 3D map coordinates for screen coordinates.

Name
Type
Description

position

Screen coordinates (x, y).

setCircleInputPoint(center, radius, segment)

Sets input points for a circle based on the center coordinates, radius, and segment.

Name
Type
Description

center

Center point latitude and longitude coordinates of the circle.

radius

number

Circle radius (in meters).

segment

number

Number of segments composing the circle.

setDistance(distance)

Sets the radius distance for the heatmap.

Name
Type
Description

distance

number

Heatmap radius.

setEffectDistance(max)

Set the maximum distance for flood, snow, and heatmap visualization.

Name
Type
Description

max

number

Maximum visibility distance for the heatmap.

setSnowfallArea(array)

Sets the range for partial snowfall effect application.

Name
Type
Description

array

Coordinates composing the range, consisting of longitude(deg), latitude(deg), and altitude(m).

setSnowfallColor(color)

Sets the color for the snowfall effect.

Name
Type
Description

color

Color for snowfall.

setTerrLODRatio(ratio)

Sets the terrain LOD update distance ratio.

<Distance for terrain update according to LOD> = \ratio * <Terrain mesh size>

Name
Type
Description

ratio

number

Terrain LOD update distance ratio.

setWeight(weight)

Sets the weight for the heatmap.

Name
Type
Description

weight

number

Weight for heatmap.

setFog(color, start, end, density)

Configures the fog effect.

Name
Type
Description

color

Fog color.

start

number

Minimum visibility distance for fog effect application (minimum value 1).

end

number

Maximum visibility distance for fog effect application.

density

number

Fog density weight (set between 0.0 and 1.0).

setFogEnable(type)

Sets whether to apply the fog effect.

Name
Type
Description

type

boolean

Whether to apply fog effect.

setRainImageURL(url) → boolean

Sets the image path for the rain effect.

Name
Type
Description

url

string

Image path for rain representation.

  • Return

    • true: Configuration successful.

    • false: Configuration failed.

  • Sample

setSnowfall(state)

Sets the output type for the snowfall effect.

When 0, the snowfall effect is disabled.

When 1, the snowfall effect is enabled (terrain texture visible).

When 2, the snowfall effect is enabled (terrain texture not visible).

Name
Type
Description

state

number

Output type for the snowfall effect.

setSnowfallLevel(level) → number

Sets the amount of snowfall during the snowfall effect.

Name
Type
Description

level

number

Amount of snowfall (set between 0 and 100).

  • Return

    • The set amount of snowfall.

  • Sample

setSnowImageURL(url) → boolean

Sets the image path for the snow effect.

Name
Type
Description

url

string

Image path for snow representation.

  • Return

    • true: Configuration successful.

    • false: Configuration failed.

  • Sample

startWeather(type, size, speed) → boolean

Activates the weather representation feature.

Name
Type
Description

type

number

Weather representation type (0: snow, 1: rain).

size

number

Representation intensity (0: weak, 1: normal, 2: strong).

speed

number

Representation speed (0: slow, 1: normal, 2: fast).

  • Return

    • true: Configuration successful.

    • false: Configuration failed.

  • Sample

stopWeather()

Deactivates the weather representation feature.

setSimpleMode(type) → boolean

Sets the building simple mode.

Name
Type
Description

type

boolean

Building simple mode.

  • Return

    • true: Configuration successful.

    • false: Configuration failed.

  • Sample

setTerrainEffect(value)

Sets the terrain rendering effect.

Name
Type
Description

value

number

Terrain rendering mode (0: normal, 10: slope direction, 11: slope degree)

updateRTT()

Updates the screen RTT.

Getter / Setter

getSelectObject(), setSelectObject(object) → JSObject

Sets the selection state for the specified object.

Name
Type
Description

object

The object to set to selection state.

getFogLimitAltitude(), setFogLimitAltitude(altitude) → number

Sets the altitude value at which the fog effect is applied.

If the camera is located below the returned altitude, the fog effect is applied.

Name
Type
Description

altitude

number

Altitude limit.

  • Return

    • number: Altitude at which the fog effect is applied.

  • Sample

Last updated