Ok, I fixed the problem with this expression:
m = thisComp.layer("Label");
m.toComp(m.anchorPoint);
Where “Label” is the shape containing the rectangle.
However, now I have one last problem. I set the beam as a 2D layer, otherwise it was overlapping the map, as you see in this picture: (the white line should track the red path)
https://oi65.tinypic.com/23tphys.jpg
However, it seems that if there is a 2D object, all the other 3D objects are not casting shadows anymore… how can I fix this?
1) Keeping the beam layer in 2D, how can I manage to keep the other layers casting shadows?
2) Converting the beam layer to a 3D object, how can I avoid overlapping with the map?
Thanks in advice.