JSLayerList
Provides an API for managing layers within a map.
Creates a Module.JSLayerList API.
let userlayer = new Module.JSLayerList(true); // Returns a user layer
let serverlayer = new Module.JSLayerList(false); // Returns a service layerFunction
count() → number
Returns the total number of layers.
Total number of user and service layers.
- Return - Total number of layers. 
 
let layerList = new Module.JSLayerList(true);
layerList.createLayer(“firstlayer”, Module.ELT_POLYHEDRON);
layerList.createLayer(“endlayer”, Module.ELT_POLYHEDRON);
let count = layerList.count();
console.log(count);createLayer(name, type) → JSLayer
Creates a new layer with the specified layer type.
name
string
Name of the layer to create.
- Return - JSLayer : Successfully returns the layer. 
- null : Fails to return the layer. 
 
let layerList = new Module.JSLayerList(true);
let layer = layerList.createLayer(“NewLayer”, Module.ELT_POLYHEDRON);createObjectLayer(option) → JSLayer
Creates a new layer with the specified layer type.
Sets the layer object with an argument variable.
Returns a user layer.
- Return - JSLayer : Successfully returns the layer. 
- null : Fails to return the layer. 
 
let layer = Module.getObjectLayerList().createObjectLayer({
    name: "Layer Name",
    type: "Layer Type",
    visible: false,
    selectable: false,
    minDistance: 100.0,
    maxDistance: 1000.0,
});createWFSLayer(name, type) → JSLayer
Creates a WFS layer.
Requests objects corresponding to the visualized Tile area from the Web Feature Server.
Use new Module.JSLayerList(false) for WFS service layers.
Name
string
Name of the layer to create.
- Return - JSLayer : Successfully returns the layer. 
- null : Fails to return the layer. 
 
let layerList = new Module.JSLayerList( false );
let wfslayer = layerList.createWFSLayer( “WFS" , 0);createWMSLayer( name ) → JSLayer
Creates a WMS layer.
Requests terrain imagery images corresponding to the visualized Tile area from the Web Map Server.
Use new Module.JSLayerList(false) for WMS service layers.
Name
string
Name of the layer to create.
- Return - JSLayer : Successfully returns the layer. 
- null : Fails to return the layer. 
 
let layerList = new Module.JSLayerList( false );
let wmslayer = layerList.createWMSLayer( “WMS” );createXDServerLayer(option) → JSLayer
Creates a new layer with the specified layer type.
Sets the layer object with an argument variable.
Returns a service layer.
- Return - JSLayer : Successfully returns the layer. 
- null : Fails to return the layer. 
 
let layer = Module.getTileLayerList().createXDServerLayer({
    name: "Layer Name",
    url: "Request Server Address",
    type: "Layer Type",
    visible: false,
    selectable: false,
    minLevel: 10,
    maxLevel: 14,
});delLayerAtFirst() → boolean
Deletes a layer.
Deletes the layer at the first order in the layer list.
Available for both user and service layers.
- Return - true : Successfully deletes the first order layer. 
- false : Fails to delete the first order layer. 
 
let layerList = new Module.JSLayerList(true);
layerList.createLayer(“firstlayer”, Module.ELT_POLYHEDRON);
layerList.createLayer(“endlayer”, Module.ELT_POLYHEDRON);
let check = layerList.delLayerAtFirst();
console.log(check);delLayerAtIndex(index) → boolean
Deletes a layer.
Deletes the layer at the specified index.
Available for both user and service layers.
index
number
Target layer index.
- Return - true : Successfully deletes the target index layer. 
- false : Fails to delete the target index layer. 
 
let layerList = new Module.JSLayerList(true);
layerList.createLayer(“firstlayer”, Module.ELT_POLYHEDRON);
layerList.createLayer(“endlayer”, Module.ELT_POLYHEDRON);
let check = layerList.delLayerAtIndex(0);
check = layerList.delLayerAtName(0);delLayerAtLast() → boolean
Deletes a layer.
Deletes the layer at the last order in the layer list.
Available for both user and service layers.
- Return - true : Successfully deletes the last order layer. 
- false : Fails to delete the last order layer. 
 
let layerList = new Module.JSLayerList(true);
layerList.createLayer(“firstlayer”, Module.ELT_POLYHEDRON);
layerList.createLayer(“endlayer”, Module.ELT_POLYHEDRON);
let check = layerList.delLayerAtLast();
console.log(check);delLayerAtName(name) → boolean
Deletes a layer.
Deletes the layer with the specified name.
Available for both user and service layers.
name
string
Target layer name.
- Return - true : Successfully deletes the target layer. 
- false : Fails to delete the target layer. 
 
let layerList = new Module.JSLayerList(true);
layerList.createLayer(“firstlayer”, Module.ELT_POLYHEDRON);
layerList.createLayer(“endlayer”, Module.ELT_POLYHEDRON);
let check = layerList.delLayerAtName(“firstlayer”);
console.log(check);
check = layerList.delLayerAtName(“endlayer”);
console.log(check);firstAtLayer() → JSLayer
Returns a layer.
Returns the layer at the first order in the layer list.
Available for both user and service layers.
- Return - JSLayer : Successfully returns the layer. 
- null : Fails to return the layer. 
 
let layerList = new Module.JSLayerList(true);
let first = layerList.createLayer(“firstlayer”, Module.ELT_POLYHEDRON);
let end = layerList.createLayer(“endlayer”, Module.ELT_POLYHEDRON);
let result = layerList.firstAtLayer();indexAtLayer(index) → JSLayer
Returns a layer.
Returns the layer at the specified index.
Available for both user and service layers.
index
number
Target layer index.
- Return - JSLayer : Successfully returns the layer. 
- null : Fails to return the layer. 
 
let layerList = new Module.JSLayerList(true);
let first = layerList.createLayer(“firstlayer”, Module.ELT_POLYHEDRON);
let end = layerList.createLayer(“endlayer”, Module.ELT_POLYHEDRON);
let result = layerList.indexAtLayer(0);
result = layerList.indexAtLayer(1);lastAtLayer() → JSLayer
Returns a layer.
Returns the layer at the last order in the layer list.
Available for both user and service layers.
- Return - JSLayer : Successfully returns the layer. 
- null : Fails to return the layer. 
 
let layerList = new Module.JSLayerList(true);
let first = layerList.createLayer(“firstlayer”, Module.ELT_POLYHEDRON);
let end = layerList.createLayer(“endlayer”, Module.ELT_POLYHEDRON);
let result = layerList.lastAtLayer();layerAtIndex(layer) → number
Checks the index of the specified layer.
Available for both user and service layers.
- Return - -1 : If the layer does not exist in the layer list. 
- result>0 : Index number of the checked layer. 
 
let layerList = new Module.JSLayerList(true);
let first = layerList.createLayer(“firstlayer”, Module.ELT_POLYHEDRON);
let end = layerList.createLayer(“endlayer”, Module.ELT_POLYHEDRON);
let count = layerList.layerAtIndex(first);
console.log(count);
count = layerList.layerAtIndex(end);
console.log(count);nameAtLayer(name) → JSLayer
Returns a created layer.
Returns a layer with the same name.
Available for both user and service layers.
name
string
Name of the layer to return.
- Return - JSLayer : Successfully returns the layer. 
- null : Fails to return the layer. 
 
let layerList = new Module.JSLayerList( false );
let layer = layerList.nameAtLayer(“HybridLoad”);setLayerMove(layer, type) → boolean
Changes the order of a layer.
Changes the index order of the specified layer based on the move condition.
Available for both user and service layers.
type
boolean
true to increase the index. false to decrease the index.
- Return - true : Successfully changes the order. 
- false: Fails to change the order. 
- Conditions for order change failure - Less than 2 layers in the layer list. 
- Attempting to move the last order layer down one level. 
- Attempting to move the first order layer up one level. 
 
 
let layerList = new Module.JSLayerList(true);
let first = layerList.createLayer(“firstlayer”, Module.ELT_POLYHEDRON);
let end = layerList.createLayer(“endlayer”, Module.ELT_POLYHEDRON);
let check =  layerList.setLayerMove(end, true);setLayerTopNBottom(layer, type) → boolean
Changes the order of a layer.
Changes the index order of the specified layer to the top or bottom based on the type condition.
Available for both user and service layers.
type
boolean
true to move the index to the top. false to move the index to the bottom.
- Return - true : Successfully changes the order. 
- false: Fails to change the order. 
- Conditions for order change failure. - Less than 2 layers in the layer list. 
- Attempting to move the last order layer down one level. 
- Attempting to move the first order layer up one level. 
 
 
let layerList = new Module.JSLayerList(true);
let first = layerList.createLayer(“firstlayer”, Module.ELT_POLYHEDRON);
let second = layerList.createLayer(“secondlayer”, Module.ELT_POLYHEDRON);
let end = layerList.createLayer(“endlayer”, Module.ELT_POLYHEDRON);
let check =  layerList.setLayerMove(first, true);getVisible(name) → number
Returns the visibility option information of a layer.
Returns the information on whether the layer is transparent/semi-transparent.
Available for both user and service layers.
name
string
Layer name.
- Return - 0 : Transparent state. 
- 1 : Visible state. 
 
let layerList = new Module.JSLayerList(false);
let visible = layerList.getVisible(“HybridLoad”);setVisible(name, type)
Sets the visibility option of a layer.
Sets the layer to a transparent/semi-transparent state.
Available for both user and service layers.
name
string
Name of the target layer.
type
boolean
true to make the layer visible. false to hide the layer.
let layerList = new Module.JSLayerList(false);
layerList.setVisible(“HybridLoad”, true);
layerList.setVisible(“HybridLoad”, false);Type Definitions
CreateObjectLayerOptions
Options for creating an object layer.
name
String
Name of the layer to create.
visible
boolean
optional
true
Sets the layer visibility option.
selectable
boolean
optional
true
Sets the option for object selection within the layer.
minDistance
number
optional
0.0
Sets the minimum visibility distance of the layer.
maxDistance
number
optional
3000.0
Sets the maximum visibility distance of the layer.
CreateServerLayerOptions
Options for creating a service layer.
name
String
Name of the layer to create.
url
String
Request server URL.
visible
boolean
optional
true
Sets the layer visibility option.
selectable
boolean
optional
true
Sets the option for object selection within the layer.
minLevel
number
optional
0
Sets the minimum visibility level of the layer.
maxLevel
number
optional
15
Sets the maximum visibility level of the layer.
Last updated
