showHideLayerByName()
Information
Implementation version: beta 1.02
Description
Shows or hides a map layer, given its name.
Invocation
showHideLayerByName( showProperty, layerName )
Input parameters
showProperty
Parameter that specifies whether you want to show or hide the layer. It is a text string that accepts one of these two possibilities:
- showLayer: to show the layer.
- hideLayer: to hide the layer.
layerName
The name of the layer from which the dataSource will be selected. This name corresponds to the name of the entity collection (featureCollection.name). It is entered as a text string.
Use examples
Hide a layer that's named 'points single':
showHideLayerByName( 'hideLayer', 'points single' )
Show that same layer again:
showHideLayerByName( 'showLayer', 'points single' )
El ejemplo visual se realizó en una versión previa, por lo que utiliza "show" y "hide" en vez de las cadenas de texto correctas de "showLayer" y "hideLayer".