How can I get the position of an element using Velo?

I want to get the position of a vector element and a button relative to the window using Wix Velo. I tried the following code:

let element = $w('#vector1');
let rect = element.getBoundingClientRect();

Any guidance or suggestions would be appreciated!