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.
Sample
Refer to function loadHeatmapPoint
var layerList = new Module.JSLayerList(true);
var layer = layerList.createLayer("HEATMAP_POI", Module.ELT_3DPOINT);
layer.setMaxDistance(60000000.0);
var vList = new Module.JSVec3Array();
var positions = [
[129.12628252638348, 35.174613788186335, -127.18464569468051],
[129.1278597986113, 35.1730738804656, -127.16845162212849],
[129.12691776723804, 35.17243834516552, -127.23446262534708],
[129.12837451707335, 35.171954803028704, -127.18164411373436],
];
positions.forEach(function (item, idx) {
vList.push(new Module.JSVector3D(item[0], item[1], 0));
});
Module.getMap().clearHeatMap();
Module.getMap().setTerrainEffect(9);
Module.getMap().setDistance(200);
Module.getMap().setWeight(1);
Module.getMap().addHeatMaps(vList);
Module.getMap().setEffectDistance(1500000);addInputPoint(lon, lat) → number
Adds a user input point.
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.
Module.getMap().addInputPoint(127.4347, 35.7016);clearHeatMap()
Initializes the heatmap.
Sample
Refer to function loadHeatmapPoint
var layerList = new Module.JSLayerList(true);
var layer = layerList.createLayer("HEATMAP_POI", Module.ELT_3DPOINT);
layer.setMaxDistance(60000000.0);
var vList = new Module.JSVec3Array();
var positions = [
[129.12628252638348, 35.174613788186335, -127.18464569468051],
[129.1278597986113, 35.1730738804656, -127.16845162212849],
[129.12691776723804, 35.17243834516552, -127.23446262534708],
[129.12837451707335, 35.171954803028704, -127.18164411373436],
];
positions.forEach(function (item, idx) {
vList.push(new Module.JSVector3D(item[0], item[1], 0));
});
Module.getMap().clearHeatMap();
Module.getMap().setTerrainEffect(9);
Module.getMap().setDistance(200);
Module.getMap().setWeight(1);
Module.getMap().addHeatMaps(vList);
Module.getMap().setEffectDistance(1500000);clearInputPoint()
Initializes the list of entered coordinates.
Sample
Refer to function clearInputPoint.
Module.getMap().clearInputPoint();clearSelectObj()
Deselects the object selection state.
Module.getMap().clearSelectObj();clearSnowfallArea()
Initializes the snowfall effect.
var pMap = Module.getMap();
pMap.clearSnowfallArea();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.
var API = {
Module.getMap();
};
var nCount = API.JSMap.getInputPointCount();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
Refer to function createPipe
var inputPoints = Module.getMap().getInputPointList();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
Refer to function createBufferPolygon.
var line = Module.getMap().getInputPoints();getTerrHeight(lon, lat) → number
Returns the terrain height value at the specified location.
lon
number
Longitude.
lat
number
Latitude.
Return
Terrain height value.
0: If the DEM for the area has not been loaded.
var height = Module.getMap().getTerrHeight(126.92836647767662, 37.52439503321471);GetPointDistance(from, to, type) → number
Returns the distance between two points.
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.
var distance = Module.getMap().GetPointDistance(new Module.JSVector3D(129.128265, 35.171834, 500.0), new Module.JSVector3D(129.118265, 35.161834, 500.0), false);getLineBuffer(coordinates, distance) → JSVec2Array
Returns the coordinates of a line buffer polygon based on the set distance.
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
Refer to function createBufferPolygon
var map = Module.getMap();
var line = map.getInputPoints();
var line2D = new Module.JSVec2Array();
for (var i = 0; i < line.count(); i++) {
line2D.push(new Module.JSVector2D(line.get(i).Longitude, line.get(i).Latitude));
}
var polygonLine = map.getLineBuffer(line2D, 100);MapRender()
Refreshes the map screen.
Module.getMap().MapRender();MapToScreenPointEX(position) → JSVector2D
Returns screen coordinates for 3D map coordinates.
Return
JSVector2D: Returns screen coordinates successfully (x, y).
null: If the engine has not been loaded properly.
Sample
Refer to function displayPopUp
var pointMapPos = Module.getMap().MapToScreenPointEX(new Module.JSVector3D(129.128265, 35.171834, 100.0));ScreenToMapPointEX(position) → JSVector3D
Returns 3D map coordinates for screen coordinates.
Return
JSVector3D: Returns coordinates (longitude, latitude, altitude) successfully.
null: Coordinate return failed.
Sample
Refer to function init
var mapPosition = Module.getMap().ScreenToMapPointEX(10, 10);setCircleInputPoint(center, radius, segment)
Sets input points for a circle based on the center coordinates, radius, and segment.
radius
number
Circle radius (in meters).
segment
number
Number of segments composing the circle.
var vCenter = new Module.JSVector(129.1475, 35.184338);
Module.getMap().setCircleInputPoint(vCenter, 500.0, 12);setDistance(distance)
Sets the radius distance for the heatmap.
distance
number
Heatmap radius.
Sample
Refer to function loadHeatmapPoint
var layerList = new Module.JSLayerList(true);
var layer = layerList.createLayer("HEATMAP_POI", Module.ELT_3DPOINT);
layer.setMaxDistance(60000000.0);
var vList = new Module.JSVec3Array();
var positions = [
[129.12628252638348, 35.174613788186335, -127.18464569468051],
[129.1278597986113, 35.1730738804656, -127.16845162212849],
[129.12691776723804, 35.17243834516552, -127.23446262534708],
[129.12837451707335, 35.171954803028704, -127.18164411373436],
];
positions.forEach(function (item, idx) {
vList.push(new Module.JSVector3D(item[0], item[1], 0));
});
Module.getMap().clearHeatMap();
Module.getMap().setTerrainEffect(9);
Module.getMap().setDistance(200);
Module.getMap().setWeight(1);
Module.getMap().addHeatMaps(vList);
Module.getMap().setEffectDistance(1500000);setEffectDistance(max)
Set the maximum distance for flood, snow, and heatmap visualization.
max
number
Maximum visibility distance for the heatmap.
Sample
Refer to function loadHeatmapPoint
var layerList = new Module.JSLayerList(true);
var layer = layerList.createLayer("HEATMAP_POI", Module.ELT_3DPOINT);
layer.setMaxDistance(60000000.0);
var vList = new Module.JSVec3Array();
var positions = [
[129.12628252638348, 35.174613788186335, -127.18464569468051],
[129.1278597986113, 35.1730738804656, -127.16845162212849],
[129.12691776723804, 35.17243834516552, -127.23446262534708],
[129.12837451707335, 35.171954803028704, -127.18164411373436],
];
positions.forEach(function (item, idx) {
vList.push(new Module.JSVector3D(item[0], item[1], 0));
});
Module.getMap().clearHeatMap();
Module.getMap().setTerrainEffect(9);
Module.getMap().setDistance(200);
Module.getMap().setWeight(1);
Module.getMap().addHeatMaps(vList);
Module.getMap().setEffectDistance(1500000);setSnowfallArea(array)
Sets the range for partial snowfall effect application.
array
Coordinates composing the range, consisting of longitude(deg), latitude(deg), and altitude(m).
var vAreaList = new Module.JSVec3Array();
vAreaList.push(new Module.JSVector3D(129.0952984771729, 35.26956608261821, 130.72385844029486));
vAreaList.push(new Module.JSVector3D(129.17153320599272, 35.26955240007246, 171.6742866402492));
vAreaList.push(new Module.JSVector3D(129.17146263440185, 35.17317375381265, 34.883301799185574));
vAreaList.push(new Module.JSVector3D(129.09531779839347, 35.17318816290076, 60.5584503589198));
vAreaList.push(new Module.JSVector3D(129.0952984771729, 35.26956608261821, 130.72385844029486));
Module.getMap().setSnowfallArea(vAreaList);setSnowfallColor(color)
Sets the color for the snowfall effect.
var snowColor = new Module.JSColor(178, 178, 178);
Module.getMap().setSnowfallColor(snowColor);setTerrLODRatio(ratio)
Sets the terrain LOD update distance ratio.
<Distance for terrain update according to LOD> = \ratio * <Terrain mesh size>
ratio
number
Terrain LOD update distance ratio.
Module.getMap().setTerrLODRatio(1.0);setWeight(weight)
Sets the weight for the heatmap.
weight
number
Weight for heatmap.
Sample
Refer to function loadHeatmapPoint
var layerList = new Module.JSLayerList(true);
var layer = layerList.createLayer("HEATMAP_POI", Module.ELT_3DPOINT);
layer.setMaxDistance(60000000.0);
var vList = new Module.JSVec3Array();
var positions = [
[129.12628252638348, 35.174613788186335, -127.18464569468051],
[129.1278597986113, 35.1730738804656, -127.16845162212849],
[129.12691776723804, 35.17243834516552, -127.23446262534708],
[129.12837451707335, 35.171954803028704, -127.18164411373436],
];
positions.forEach(function (item, idx) {
vList.push(new Module.JSVector3D(item[0], item[1], 0));
});
Module.getMap().clearHeatMap();
Module.getMap().setTerrainEffect(9);
Module.getMap().setDistance(200);
Module.getMap().setWeight(1);
Module.getMap().addHeatMaps(vList);
Module.getMap().setEffectDistance(1500000);setFog(color, start, end, density)
Configures the fog effect.
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).
Sample
Refer to function loadHeatmapPoint.
var pMap = Module.getMap();
pMap.setFogLimitAltitude(6000000.0);
pMap.setFogEnable(true);
var color = new Module.JSColor(255, 255, 255, 255);
pMap.setFog(color, 0, 5000, 0.3);setFogEnable(type)
Sets whether to apply the fog effect.
type
boolean
Whether to apply fog effect.
Sample
Refer to function loadHeatmapPoint
var pMap = Module.getMap();
pMap.setFogLimitAltitude(6000000.0);
pMap.setFogEnable(true);
var color = new Module.JSColor(255, 255, 255, 255);
pMap.setFog(color, 0, 5000, 0.3);setRainImageURL(url) → boolean
Sets the image path for the rain effect.
url
string
Image path for rain representation.
Return
true: Configuration successful.
false: Configuration failed.
Sample
Refer to function changeRainEffectOption.
var pMap = Module.getMap();
pMap.setRainImageURL("./data/snow./png");
pMap.startWeather(1, 5, 5);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).
state
number
Output type for the snowfall effect.
Sample
Refer to function setUseSnowEffect.
var pMap = Module.getMap();
pMap.startWeather(0, 5, 5);
pMap.setSnowfall(1);
pMap.setSnowfallLevel(2.0);setSnowfallLevel(level) → number
Sets the amount of snowfall during the snowfall effect.
level
number
Amount of snowfall (set between 0 and 100).
Return
The set amount of snowfall.
Sample
Refer to function setUseSnowEffect.
var pMap = Module.getMap();
pMap.startWeather(0, 5, 5);
pMap.setSnowfall(1);
pMap.setSnowfallLevel(2.0);setSnowImageURL(url) → boolean
Sets the image path for the snow effect.
url
string
Image path for snow representation.
Return
true: Configuration successful.
false: Configuration failed.
Sample
Refer to function changeRainEffectOption.
var pMap = Module.getMap();
pMap.setSnowImageURL("./data/snow./png");
pMap.startWeather(0, 5, 5);
pMap.setSnowfall(1);
pMap.setSnowfallLevel(2.0);startWeather(type, size, speed) → boolean
Activates the weather representation feature.
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
Refer to function setUseRainEffect.
var pMap = Module.getMap();
pMap.startWeather(1, 5, 5);stopWeather()
Deactivates the weather representation feature.
var pMap = Module.getMap();
pMap.stopWeather();setSimpleMode(type) → boolean
Sets the building simple mode.
type
boolean
Building simple mode.
Return
true: Configuration successful.
false: Configuration failed.
Sample
Refer to function setUseRainEffect
Module.getMap().setSimpleMode(true);setTerrainEffect(value)
Sets the terrain rendering effect.
value
number
Terrain rendering mode (0: normal, 10: slope direction, 11: slope degree)
Sample
Refer to function setUseRainEffect.
Module.getMap().setTerrainEffect(10);updateRTT()
Updates the screen RTT.
Module.getMap().updateRTT();Getter / Setter
getSelectObject(), setSelectObject(object) → JSObject
Sets the selection state for the specified object.
var selObject = Module.getMap().getSelectObject();
// ... or ...
var object = GLOBAL.Layer.keyAtObject("object_select");
Module.getMap().setSelectObject(object);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.
altitude
number
Altitude limit.
Return
number: Altitude at which the fog effect is applied.
Sample
Refer to function loadHeatmapPoint.
var limitAltitude = Module.getMap().getFogLimitAltitude();
// ... or ...
var pMap = Module.getMap();
pMap.setFogLimitAltitude(6000000.0);
pMap.setFogEnable(true);
var color = new Module.JSColor(255, 255, 255, 255);
pMap.setFog(color, 0, 5000, 0.3);Last updated