JSLayer
API for managing objects within a map.
Can be created with the Module createLayer API.
User layers can be created with the Module createObjectLayer API.
Service layers can be created with the Module createXDServerLayer API.
let layerList = new Module.JSLayerList(true);
let layer = layerList.createLayer("Layer Name");Properties
altitude_offset
number
Real-time height setting for point cloud, drone LOD data.
lod_object_alpha
number
Set alpha value for service layer properties.
lod_object_detail_ratio
number
Set visibility distance ratio for service layer objects.
serverURL
string
Returns request server URL.
simple_real3d
boolean
Set building object simple mode.
text_character_set
string
Set layer text character set value.
tile_load_ratio
number
Set visibility distance ratio for service layer.
Function
addObject(object, level)
Add an object to the user layer.
Only available for user layers.
Use level 0 consistently.
level
number
Use value 0
let layername = "objectlayer";
let layerList = new Module.JSLayerList(true);
let layer = layerList.createLayer(layername);
layer.addObject(object, 0);clearWMSCache()
Clears the cache of loaded WMS layer images.
var layerList = new Module.JSLayerList(false);
//...(Add WMS layer)...
var layer = layerList.nameAtLayer(“WMSLayer”);
layer.clearWMSCache();getObjectCount() → number
Returns the number of objects in the layer.
Only available for user layers.
- Return - -1 : If there are no objects in the layer. 
- result>0 : Number of objects in the layer. 
 
getObjectKeyList() → string
Returns the names of objects in the layer.
Manages objects in the user layer as a list and returns the names of all list objects.
Available for user layers.
- Return - string : Successfully returns object names (separator ","). 
- "" : Fails to return object names. 
- Failure conditions - If the number of objects in the layer is 0. 
- In the case of service layers (objects in service layers are dependent on tiles). 
 
 
getType() → number
Returns the type value of the layer.
- Return - number(0 or higher) : Returns the layer type (Layer Type List). 
- number(-1) : If the layer object does not exist. 
 
var layerList = new Module.JSLayerList(false);
//...(Add WMS layer)...
var layer = layerList.nameAtLayer(“WMSLayer”);
var bVisible = layer.getType();indexAtKey(index) → string
Returns the object ID in the user layer.
Manages objects in the user layer as a list and returns the object ID corresponding to the list Index.
Only available for user layers.
index
number
Target object Index.
- Return - string : Successfully returns the object ID corresponding to the Index. 
- "" : Fails to return the object ID corresponding to the Index. 
- Failure conditions - If the Index exceeds the range of the object list (less than 0 or greater than the number of objects in the list). 
 
 
indexAtObject(index) → JSObject
Returns the object in the user layer.
Manages objects in the user layer as a list and returns the object corresponding to the list index.
Only available for user layers.
index
number
Index of the registered object.
- Return - JSObject : Successfully returns the object corresponding to the Index. 
- null : Fails to return the object corresponding to the Index. 
- Failure conditions - If the Index exceeds the range of the object list (less than 0 or greater than the number of objects in the list). 
- If the number of objects in the layer is 0. 
 
 
keyAtObject(name) → JSObject
Returns the object in the user layer.
Manages objects in the user layer as a list and sequentially compares the object ID with objectid, returning the matching object.
Only available for user layers.
name
string
Name of the registered object.
- Return - JSObject : Successfully returns the object with the same name. 
- null : Fails to return the object with the same name. 
- Failure conditions - If there is no object with the same name. 
- If there is no string data for name. 
- If the number of objects in the layer is 0. 
 
 
removeAtIndex(index) → boolean
Deletes an object in the user layer.
Manages objects in the user layer as a list and deletes the object corresponding to the list Index.
Only available for user layers.
index
number
Index of the registered object.
- Return - true : Successfully deletes the object. 
- false : Fails to delete the object. 
- Failure conditions - If the index exceeds the range of the object list (less than 0 or greater than the number of objects in the list). 
- If the number of objects in the layer is 0. 
- In the case of a service layer (objects in service layers are dependent on tiles). 
- If the data was loaded through an external server (e.g., WMS, WFS). 
 
 
let layername = "objectlayer"
let layerList = new Module.JSLayerList(true);
let layerList.createLayer(layername );
layer.addObject(object, 0);
layer.removeAtIndex(0);removeAtKey(name) → boolean
Deletes an object in the user layer.
Manages objects in the user layer as a list and sequentially compares the object name with name, then deletes the matching object.
Only available for user layers.
name
string
Name of the registered object.
- Return - true : Successfully deletes the object. 
- false : Fails to delete the object. 
- Failure conditions - If there is no object with the same objectid. 
- If there is no string data for name. 
- If the number of objects in the layer is 0. 
- In the case of a service layer (objects in service layers are dependent on tiles). 
- If the data was loaded through an external server (e.g., WMS, WFS). 
 
 
removeAtObject(object) → boolean
Deletes an object in the user layer.
Manages objects in the user layer as a list and sequentially compares the object with object, then deletes the matching object.
Only available for user layers.
- Return - true : Successfully deletes the object. 
- false : Fails to delete the object. 
- Failure conditions - If there is no object identical to object. 
- If the number of objects in the layer is 0. 
- In the case of a service layer (objects in service layers are dependent on tiles). 
- If the data was loaded through an external server (e.g., WMS, WFS). 
 
 
removeAll() → boolean
Deletes all objects in the user layer.
Deletes the entire object list in the layer.
Only available for user layers.
- Return - true : Successfully deletes the objects. 
- false : Fails to delete the objects. 
- Failure conditions - If the number of objects in the layer is 0. 
- In the case of a service layer (objects in service layers are dependent on tiles). 
- If the data was loaded through an external server (e.g., WMS, WFS). 
 
 
setConnectionWFS(url, port, param) → boolean
Sets the connection information for a WFS layer.
url
string
Data request URL.
port
number
Data request Port.
param
string
Data request parameters.
- Return - true : If successfully set. 
- false : If the layer does not exist or if the layer type is not a tile layer type. 
 
var API = {
    JSLayerList : new Module.JSLayerList(false)
};
var layer = API.JSLayerList.createWFSLayer(“newWFSLayer”, 0);
var dataURL = “http://...(Data request URL)...”;
var parameter= “...(Data request parameters)...”;
layer.setConnectionWFS(dataURL, 0, parameter);setConnectionWMS(url, port, param) → boolean
Sets the connection information for a WMS layer.
url
string
Data request URL.
port
number
Data request Port.
param
string
Data request parameters.
- Return - true : If successfully set. 
- false : If the layer does not exist or if the layer type is not a tile layer type. 
 
var API = {
    JSLayerList : new Module.JSLayerList(false)
};
var layer = API.JSLayerList.createWMSLayer(“newWMSLayer”, 0);
var dataURL = “http://...(Data request URL)...”;
var parameter= “...(Data request parameters)...”;
layer.setConnectionWMS(dataURL, 0, parameter);setFontStyle(fontName, fontSize, fontWeight, color, outColor)
Sets the font style for WFS.
var API = {
    JSLayerList : new Module.JSLayerList(false)
};
var layer = API.JSLayerList.createWFSLayer(“newWFSLayer”, 0);
var dataURL = “http://...(Data request URL)...”;
var parameter= “...(Data request parameters)...”;
layer.setConnectionWFS(dataUrl, 0, parameter);
var clrFont     = new Module.JSColor(255, 255, 255, 255);
var clrOutLine  = new Module.JSColor(255, 0, 0, 0);
layer.setFontStyle(“Arial ”, 20, 10, clrFont, clrOutLine);setLevelWFS(level)
Sets the data output level range for a WFS layer.
level
number
Maximum data output level.
var API = {
    JSLayerList : new Module.JSLayerList(false)
};
var layer = API.JSLayerList.createWFSLayer(“newWFSLayer”, 0);
var dataURL = “http://...(Data request URL)...”;
var parameter= “...(Data request parameters)...”;
layer.setConnectionWFS(dataUrl, 0, parameter);
layer.setLevelWFS(10);setLevelWMS(minLevel, maxLevel) → boolean
Sets the data output level range for a WMS layer.
minLevel
number
Minimum data output level.
maxLevel
number
Maximum data output level.
- Return - true : If successfully set. 
- false : If the layer does not exist or if the layer type is not a tile layer type. 
 
var API = {
    JSLayerList : new Module.JSLayerList(false)
};
var layer = API.JSLayerList.createWMSLayer(“newWMSLayer”);
var dataURL = “http://...(Data request URL)...”;
var parameter= “...(Data request parameters)...”;
layer.setConnectionWMS(dataUrl, 0, parameter);
layer.setLevelWMS(10, 12);setLODRatio(ratio)
Sets the visibility range for the layer.
Adjusts object visibility by changing the LOD of the service layer.
Only available for service layers.
ratio
number
LOD level setting (higher values increase visibility range).
- Sample - Refer to function init. 
 
setProxyRequest(type)
Sets the use of a proxy for the layer.
Sets whether to use a proxy for object communication requests.
Only available for service layers.
type
boolean
true to use a proxy server, false for default request settings.
- Return - true : If proxy setting is successful. 
- false : If proxy setting fails. 
- Failure conditions - In the case of a user layer. 
 
 
- Sample - Refer to function createLayerWMS. 
 
setRecoverHsvValue(hue, saturation, value) → boolean
Sets the HSV color channel for the service layer.
Sets object HSV channel visualization with input values for color (hue), saturation, and brightness (value).
Applicable only to buildings and drone LOD layers.
hue
number
HSV channel (hue).
saturation
number
HSV channel (saturation).
value
number
HSV channel (value).
- Return - true : If HSV channel setting is successful. 
- false : If HSV channel setting fails. 
 
- Sample - Refer to function setHSV. 
 
setRequestFeatureCount(count)
Specifies the tile size for WFS data requests.
count
number
Request unit tile size.
- Return - true : If successfully set. 
- false : If the layer type is not a tile layer type or not a WFS layer type. 
 
- Note - The larger the request unit, the larger the tile range for WFS data requests. 
 
var layerList = new Module.JSLayerList(false);
var layer = GLOBAL.JSLayerList.createWFSLayer(“NewWFSLayer”, 0);
layer.setRequestFeatureCount(64);setStylesWMS(style)
Sets the style of the layer to request.
style
string
Request layer style.
- Return - true : If successfully set. 
- false : If the layer does not exist or if the layer type is not a tile layer type. 
 
var API = {
    JSLayerList : new Module.JSLayerList(false)
};
var layer = API.JSLayerList.createWMSLayer(“newWMSLayer”);
var dataURL = “http://...(Data request URL)...”;
var parameter= “...(Data request parameters)...”;
layer.setConnectionWMS(dataUrl, 0, parameter);
layer.setStylesWMS(“LT_C_UQ111”);setTileAltitudeOffset(offset) → boolean
Sets the initial altitude value for the service (default 0).
Sets the height of objects when loading based on the initial altitude (offset). The height of visible objects does not change.
Applicable only to point cloud layers.
The height altitude setting varies depending on the offset input value: tilt<0 (rise), 0 (original altitude), tilt>0 (descend).
offset
number
Altitude setting for the point cloud.
- Return - true : If height setting is successful. 
- false : If height setting fails. 
 
- Sample - Refer to function init. 
 
setTileSizeWMS(size)
Set the pixel size of the WMS layer tile.
size
number
Pixel size of the tile.
- Return - true : If successfully set. 
- false : If the layer does not exist or if the layer type is not a tile layer type. 
 
var API = {
    JSLayerList : new Module.JSLayerList(false)
};
var layer = API.JSLayerList.createWMSLayer(“newWMSLayer”);
var dataURL = “http://...(Data request URL)...”;
var parameter= “...(Data request parameters)...”;
layer.setConnectionWMS(dataUrl, 0, parameter);
layer.setTileSizeWMS(tileSize);setUseRecoverHsv(type) → boolean
Sets the color representation for the service layer.
Sets object representation using the HSV color channel.
Applicable only to buildings and drone LOD layers.
type
boolean
true for HSV channel visualization false for default visualization.
- Return - true : If HSV channel visualization setting is successful. 
- false : If HSV channel visualization setting fails. 
 
- Sample - Refer to function setHSV. 
 
setWFSDescField(fieldName) → boolean
Sets the tag name to store as Description data among WFS data.
fieldName
string
Tag name to store as Description data.
- Return - true : If successfully set. 
- false : If the layer type is not a tile layer type or not a WFS type layer. 
 
var layerList = new Module.JSLayerList(false);
var layer = GLOBAL.JSLayerList.createWFSLayer(“NewWFSLayer”, 0);
layer.setWFSPropertyName(“STD_SGGCD,BONBUN,AG_GEOM”);
layer.setWFSDescField(“STD_SGGCD”);
"Received WFS Data"
<gml:featureMember>
<LT_P_BONBUN gml:id="LT_P_BONBUN.253000">
//...omitted...
<STD_SGGCD>26500</STD_SGGCD>
<BONBUN>708</BONBUN>
<AG_GEOM>
//...omitted...
</gml:featureMember>setWFSPointName(fieldName)
Set the POI visualization string tag name in the XML format requested from the WFS service layer.
fieldName
string
tag name.
- Return - true: Setup successful. 
- false: Setting failure. 
- Failure conditions - If it is not a service layer. 
- If it is not a WFS layer type. 
 
 
var API = {
    JSLayerList : new Module.JSLayerList(false)
};
var layer = API.JSLayerList.createWFSLayer(“newWFSLayer”, 0);
var dataURL = “http://...(Data request URL)...”;
var parameter= “...(Data request parameters)...”;
layer.setConnectionWFS(dataUrl, 0, parameter);
layer.setWFSPointName(“BONBUN”);
"Received WFS Data"
<gml:featureMember>
<LT_P_BONBUN gml:id="LT_P_BONBUN.253000">
//...omitted...
<STD_SGGCD>26500</STD_SGGCD>
<BONBUN>708</BONBUN>
<AG_GEOM>
//...omitted...
</gml:featureMember>setWFSPropertyName(propertyName)
Sets the list of tags to receive as property data for WFS.
propertyName
string
Property data tag list.
- Return - true : If successfully set. 
- false : If the layer type is not a tile layer type or not a WFS type layer. 
 
- Note - The set WFS tag list is applied to the “propertyname” parameter among WFS data request parameters. 
 
var layerList = new Module.JSLayerList(false);
var layer = GLOBAL.JSLayerList.createWFSLayer(“NewWFSLayer”, 0);
layer.setWFSPropertyName(“STD_SGGCD,BONBUN,AG_GEOM”);setWFSTextColor(lineColor, fillColor)
Sets the outline and fill colors of text for POI WFS data output.
var layerList = new Module.JSLayerList(false);
var layer = GLOBAL.JSLayerList.createWFSLayer(“NewWFSLayer”, 0);
var lineColor = new Module.JSColor(255, 255, 255, 255);
var fillColor = new Module.JSColor(255, 0, 0, 0);
layer.setWFSTextColor(lineColor , fillColor);setWMSProvider(option) → string
Creates a WMS layer
Creates a WMS service layer with the argument variable options.
- Return - success : If WMS layer creation is successful. 
- string : Error message during WMS layer creation process. 
 
- Sample - Refer to function createLayerWMS. 
 
let slopeoption = {
	url: strUrl,
	layer: strLayer,
	minimumlevel: 0,
	maximumlevel: 20,
	tilesize: 256,
	crs: "EPSG:5174",
	parameters: {
		version: "1.1.0",
		SERVICE=WMS,
		REQUEST=GetMap,
		FORMAT=image/png,
		VERSION=1.1.0,
		TRANSPARENT=TRUE,
		enablePickFeatures: true,
	}
};setWMSTransparent(transparent)
Sets the transparency of the WMS layer.
transparent
boolean
Layer output mode. true: Layer output in semi-transparent mode false: Layer output in opaque mode
- Note - If set to true, the terrain image is also visible in a semi-transparent state, while setting to false will output the layer in an opaque state without showing the terrain image. 
 
var layerList = new Module.JSLayerList(false);
//...
var layer = layerList.nameAtLayer(“WMSLayer”);
layer.setWMSTransparent(true);setWMSVersion(version)
Sets the request version for WMS images.
version
string
The data request version to set.
- Return - true : If successfully set. 
- false : If the layer does not exist or if the layer type is not a tile layer type. 
 
var layerList = new Module.JSLayerList(false);
//...(Add WMS layer)...
var layer = layerList.nameAtLayer(“WMSLayer”);
layer.setWMSVersion(“1.1.0”);Getter / Setter
getAlpha(), setAlpha(alpha) → number
Sets the transparency of objects existing in the service building layer.
Sets the transparency of objects in simple mode of the service building layer.
alpha
number
Set alpha value for service layer properties
- Conditions for transparency setting failure - In the case of a user layer. 
- For service layers other than buildings. 
 
getBBoxOrder(), setBBoxOrder(type) → boolean
Sets options for a WMS service layer.
Sets the visualization option for coordinate information requested to the GeoServer.
Available for WMS layers.
Depending on the input value type, coordinate information is set as true(BBOX=minx,miny,maxx,maxy), false(BBOX=minY,minX,maxY,maxX).
type
boolean
Coordinate option setting.
- Sample - Refer to function createLayerWMS. 
 
getEditable(), setEditable(edit) → boolean
Sets the layer as an editing layer.
A layer that manages objects created within the engine.
Only available for user layers.
Changing to an editing layer will change the previous editing layer to a regular layer.
edit
boolean
true to set as an editing layer. false to set as a regular layer.
- Conditions for editing layer setting failure - In the case of a service layer (objects in service layers are dependent on tiles). 
 
- Sample - Refer to function initSamplePage. 
 
getMinDistance(), setMinDistance(distance) → number
Sets the visibility range of the layer.
Sets the minimum visibility distance of the layer.
Only available for user layers.
distance
number
Minimum visibility distance of the layer (in meters).
- Conditions for minimum visibility range setting failure. - If the minimum visibility range is greater than the maximum visibility range. 
- In the case of a service layer. 
 
- Sample - Refer to function showGrid. 
 
getMaxDistance(), setMaxDistance(distance) → number
Sets the visibility range of the layer.
Sets the maximum visibility distance of the layer.
Only available for user layers.
distance
number
Maximum visibility distance of the layer (in meters).
- Conditions for maximum visibility range setting failure. - If the maximum visibility range is less than the minimum visibility range. 
- In the case of a service layer. 
 
- Sample - Refer to function showGrid. 
 
getMaxLevel(), setMaxLevel(level) → number
Sets the maximum visibility level of the layer.
Only available for service layers.
level
number
Maximum visibility level of the layer.
- Conditions for maximum visibility level setting failure. - In the case of a user layer. 
 
getName(), setName(name) → string
Sets the name of the layer.
name
string
New name for the layer.
var layerList = new Module.JSLayerList(false);
//...(Add WMS layer)...
var layer = layerList.nameAtLayer(“WMSLayer”);
layer.setName(“WMSLayer2”);getObjectHorizontal(), setObjectHorizontal(horizontal) → number
Sets the size of box objects in the layer.
Sets the real-time size for parabolic animation.
Sets the horizontal size of box objects.
horizontal
number
Horizontal size setting for box objects.
- Failure conditions - If a value less than 0 is entered. 
- When an object is not created with createTimeSeriesObject() API 
 
- Sample - Refer to function JsonLoad. 
 
getObjectVertical(), setObjectVertical(vertical) → number
Sets the size of box objects in the layer.
Sets the real-time size for parabolic animation.
Sets the vertical size of box objects.
vertical
number
Vertical size setting for box objects.
- Failure conditions - If a value less than 0 is entered. 
- When an object is not created with createTimeSeriesObject() API 
 
- Sample - Refer to function JsonLoad. 
 
getSelectable(), setSelectable(type) → boolean
Sets the selection setting for the layer.
Sets the object selection event for the layer.
Available for both user and service layers.
type
boolean
true for enabling selection events. false for disabling selection events.
getTimeSeriesCount(), setTimeSeriesCount(step) → number
Sets the animation step for box objects in the layer.
step
number
Animation Step setting.
- Conditions for animation step setting failure. - If a value less than the minimum step entered is input. 
- If a value greater than the maximum step entered is input. 
- If objects were not created with the createTimeSeriesObject() API. 
 
- Sample - Refer to function JsonLoad. 
 
getTimeSpeed(), setTimeSpeed(speed) → number
Sets the speed of height change for objects during animation step transition.
speed
number
Animation transition speed setting.
- Conditions for animation step setting failure. - If a value less than the minimum step entered is input. 
- If a value greater than the maximum step entered is input. 
- If objects were not created with the createTimeSeriesObject() API. 
 
getViewLimit(), setViewLimit(tilt) → number
Sets the tilt limitation for layer visibility.
Sets objects to a transparent state if the camera tilt is less than the input value.
Limitation setting for CSV, billboard, POI, and building objects.
Only available for service layers.
tilt
number
Sets object visibility based on camera angle.
getVisible(), setVisible(type) → boolean
Returns the visibility option information of the layer.
Returns the information on whether the layer is transparent/semi-transparent.
Available for both user and service layers.
type
boolean
true for layer visibility. false for hiding the layer.
- Sample - Refer to function JsonLoad. 
 
getWMSRequestParam(), setWMSRequestParam(parameter) → string
- Alternative API: setWMSProvider 
getWMSVersion(), setWMSVersion(version) → string
- Alternative API: setWMSProvider 
getUnion(), setUnion(union) → boolean
- Not used 
Type Definitions
WMSOptions
Basic creation options for a WMS layer.
url
string
Request GeoServer URL.
layer
string
Request GeoServer layer name.
minimumLevel
number
optional
0
Minimum visibility level.
maximumLevel
number
optional
15
Maximum visibility level.
tileSize
number
optional
256
Requested square image size.
crs
string
optional
EPSG:4326
Coordinate type.
WMSOptions.SubOptions
Additional creation options for a WMS layer.
Other options are added to the parameters structure and automatically included in the URL.
e.g., style option, etc.
version
string
optional
1.1.0
GeoServer request version.
service
string
optional
WMS
GeoServer request type.
request
string
optional
GetMap
GeoServer map request type.
format
string
optional
image/png
GeoServer image request type.
transparent
string
optional
TRUE
Transparency option for image request.
Last updated
