Copy link to clipboard
Copied
i have created script about layer.marker and it works fine.
but when there are no marker on the layer, the error comes up.
is there any ways to hide the error? maybe like 'hasParent' function.
because i want to make it as preset and let the user freely to put the marker whenever they want. thanks!
Copy link to clipboard
Copied
Hey.
You can check for numKeys property to determine if a layer has any markers applied.
http://docs.aenhancers.com/properties/property/#property-numkeys
Copy link to clipboard
Copied
Sounds like you want to write expressions instead of a script, but also with expressions it is as Tomas said: Check for numkeys:
if (myLayer.marker.numKeys == 0) {
// do here whatever you want to do when no marker exists
}
else {
// do where whatever you want to do if a marker exists
}