Travis Bobier
 · Professional Nerd

Ceros SDK: Layer-level Commands Glossary

About this Guide

This article contains a glossary of Ceros SDK layer-level commands to use when writing your own SDK code. Please note that all listed commands are as is, and we cannot guarantee all functionality to work across all experiences and devices.

findAllComponents()

called onCerosLayer arguments: none

Returns a CerosComponentCollection containing the components in the CerosLayer.

var components = myLayer.findAllComponents();
components.click(); //clicks all components in the first layer

show()

called onCerosLayer or CerosLayerCollection arguments: none

Makes the layer(s) visible. If this is called on a layer that is already visible, it will have no effect. Any entry animations configured on components in this layer will be triggered.

var myLayer = myExperience.findLayerById('a-layer-id');
myLayer.show();

hide()

called onCerosLayer or CerosLayerCollection arguments: none

Hides the layer(s). If this is called on a layer that is already hidden, it will have no effect. Any exit animations configured on components in this layer will be triggered.

var myLayer = myExperience.findLayerById('a-layer-id');
myLayer.hide();

getPage()

called onCerosLayer arguments: none

Retrieves the CerosPage that this layer belongs to.

var myPage = myExperience.findLayerById('a-layer-id').getPage();

getPayload()

called onCerosLayer arguments: none

Retrieves the payload for the layer, if you have configured one in the Studio. If there is not a payload configured, this will return undefined.

var myPayload = myExperience.findLayerById('a-layer-id').getPayload();

getTags()

called onCerosLayer arguments: none

Retrieves the tags for the layer, if you have tagged it with any in the Studio. If the layer has not been tagged, then an empty array is returned.

var tags = myExperience.findLayerById('a-layer-id').getTags();

isComponent()

called onCerosLayer arguments: none

Returns true if the layer is a component or group

var myLayer = myExperience.findLayerById('a-layer-id');
if (myLayer.isComponent()) {
    myLayer.show();
}

isGroup()

called onCerosLayer arguments: none

Returns true if the layer is a group

var myLayer = myExperience.findLayerById('a-layer-id');
if (myLayer.isGroup()) {
    myLayer.show();
}

isSyncedObject()

called onCerosLayer arguments: none

Returns true if the layer is a synced object

var myLayer = myExperience.findLayerById('a-layer-id');
if (myLayer.isSyncedObject()) {
    myLayer.show();
}

isFolder()

called onCerosLayer arguments: none

Returns true if the layer is a folder

var myLayer = myExperience.findLayerById('a-layer-id');
if (myLayer.isFolder()) {
    myLayer.show();
}

on(eventName, callback)

called onCerosLayer or CerosLayerCollection argumentseventName – The name of the event to subscribe to callback – The function to run when this event is received

merge(layerCollections)

called onCerosLayerCollection argumentslayerCollections – An array of CerosLayerCollections to merge 

See Events

1