hideLayer()
Turns the layer off.
Returns:
String: Returns a message that shows turning layer off was successful or not. Null message means turning off was successful.
Example:
const allFeatureLayers = map.getFeatureLayers(); const intendedLayer = allFeatureLayers["<intended layer name>"]; intendedLayer.hideLayer();
showLayer()
Turns the layer on.
Returns:
String: Returns a message that shows turning layer on was successful or not. Null message means turning on was successful.
Example:
const allFeatureLayers = map.getFeatureLayers(); const intendedLayer = allFeatureLayers["<intended layer name>"]; intendedLayer.showLayer();
changeColor(color, geometryType)
To change the color of layers that can be displayed with more than one color (such as polygon layers that, in addition to fill-color, which is the color of the surface of the layer, also have fill-outline-color, which is the color of the outer border of the layer), you can use the color field key as the second argument of the function (if you don’t enter the second argument, the default key of each geometry will be used).
Parameters:
color(String): New color for this layer. rgb, rgba and hexadecimal values are accepted.
geometryType(String) is desired part of geometry for changing color.
Returns:
String: Returns a message that shows color changing was successful or not. Null message means changing was successful.
Example:
const allFeatureLayers = map.getFeatureLayers(); const intendedLayer = allFeatureLayers["<intended layer name>"]; intendedLayer.changeColor('red','fill-outline-color');
changeWidth(width)
Changes the width of the linear layer.
Parameters:
width: new width number.
Example:
const allFeatureLayers = map.getFeatureLayers(); const intendedLayer = allFeatureLayers["<intended layer name>"]; intendedLayer.changeWidth(5);
changeRadius(radius)
Changes the circle diameter of the point layer.
Parameters:
radius(Number): new radius number.
Example:
const allFeatureLayers = map.getFeatureLayers(); const intendedLayer = allFeatureLayers["<intended layer name>"]; intendedLayer.changeRadius(5);
changeSelectionColor(color)
Changes selection color of features.
Parameters:
color(String): New selection color for this layer. rgb, rgba and hexadecimal values are accepted.
Returns:
String: Returns a message that shows color changing was successful or not. Null message means changing was successful.
Example:
const allFeatureLayers = map.getFeatureLayers(); const intendedLayer = allFeatureLayers["<intended layer name>"]; intendedLayer.changeSelectionColor('red');
changeHighlightColor(color)
Changes highlight color of features.
Parameters:
color(String): New highlight color for this layer. rgb, rgba and hexadecimal values are accepted.
Returns:
String: Returns a message that shows color changing was successful or not. Null message means changing was successful.
Example:
const allFeatureLayers = map.getFeatureLayers(); const intendedLayer = allFeatureLayers["<intended layer name>"]; intendedLayer.changeHighlightColor('#0000ff');