Working with raster layer

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 allRasterLayers = map.getRasterLayers();
const intendedLayer = allRasterLayers["<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 allRasterLayers = map.getRasterLayers();
const intendedLayer = allRasterLayers["<intended layer name>"];
intendedLayer.showLayer(); 

Leave a comment

Your email address will not be published. Required fields are marked *