Offset to Observer Height with Line of Sight Widget?

333
4
07-17-2020 09:45 AM
JasonJordan00
Occasional Contributor

Is it possible when a user interactively sets a observer position with the line of sight widget to add a vertical offset? For instance if the observer was 6 ft tall?

0 Kudos
4 Replies
JethroLeevers
New Contributor III

Adding a bump to this question

Is this on the roadmap for the ArcGIS Javascript API in the near future?

A vertical offset for the targets would be great too.

As a use case:

Determining if a fence is a sufficient height

0 Kudos
RalucaNicola1
Esri Contributor

Sorry for the late reply. This is currently not possible out of the box and it is not on our road map. 

Thinking about it, it should be possible to watch for updates on the observer and offsetting it. There is a risk in running into an infinite loop, that's why I am removing the watcher when I set the observer with the new height. Also the user experience is not so nice if I offset the observer right after the user changes it, so I am waiting for the user to not interact with the view anymore. And to catch also the case when a user places an observer for the first time (the view is interacting in that case), I am also checking whether the change in value was from null to a new value.

Long story short, here is the code: https://codepen.io/nicolaraluk/pen/wvGRxPE?editors=1000 

Jason JordanJethro Leevers‌, let me know if this helps.

JethroLeevers
New Contributor III

Thanks Raluca,

Not the ideal solution but I can live with a work around for now.

Would be great to see it on the roadmap in the future.

0 Kudos
RalucaNicola1
Esri Contributor

I'll pass the request on to the team Jethro  let me know also if you have more use cases or specific requirements.

0 Kudos