Main Content

getLayer

Return individual layers from multilayer map

Since R2021a

Description

example

mapLayer = getLayer(map,layerName) returns the individual map layer, specified by the layer name layerName. For a list of all layer names, see the LayerNames property of the multiLayerMap object map.

Examples

collapse all

Create two occupancy map layers. Then, combine the map layers into a multiLayerMap object.

map1 = occupancyMap(10,10,"LayerName","Layer1");
map2 = occupancyMap(repmat(0:0.1:0.9,10,1),"LayerName","Layer2");
multiMap = multiLayerMap({map1,map2});

Get the first map layer from the multilayer map.

mapLayer1 = getLayer(multiMap,"Layer1");
show(mapLayer1)

Get the second map layer from the multilayer map.

mapLayer2 = getLayer(multiMap,"Layer2");
show(mapLayer2)

Input Arguments

collapse all

Multilayer map, specified as a multiLayerMap object.

Name of individual map layer, specified as a string scalar or character vector.

Data Types: char | string

Output Arguments

collapse all

Individual map layer, returned as a binaryOccupancyMap, occupancyMap, or mapLayer object as a handle. For more information, see Handle Object Behavior.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2021a