Select to view content in your preferred language

BUG: Line of Sight widget

738
5
11-20-2022 10:36 PM
JethroLeevers
Regular Contributor

I have been using the method outlined in the following example to add an observer offset:-

https://community.esri.com/t5/arcgis-api-for-javascript-questions/offset-to-observer-height-with-lin...

In the latest 4.25 release, the observer property no longer contains a valid value for z when used over terrain, it only returns the value 0. Thus, when creating an updated observer point based on an offset and the observer value, the new observer point is underground (or 0 + offset)

The z-value is correct when over a model or mesh.

0 Kudos
5 Replies
GreteSoosalu
Esri Contributor

Hi @JethroLeevers 

You can still use the same method but since the API version 4.23 it is not necessary to call viewModel.start() and viewModel.stop() anymore (part of a bug fix shipped with 4.23, see release notes or the Line of Sight widget sample).

So if you remove that part, the old sample app with the workaround will function again. 

Hope this helps! 

0 Kudos
JethroLeevers
Regular Contributor

Hi @GreteSoosalu 

The issue is related to the observer point, when I add a watch on the observer:-

ObserverWatchHandle = lineOfSightVM.watch("observer", (value) => {
  console.log(value.z)
}

the value of value.z is always returned as 0 when used over the ground, I believe this should be the z-value at the ground point 

0 Kudos
JethroLeevers
Regular Contributor

This bug seems to have existed in 4.24 too but not <= 4.23

I have created a code pen with the 2 different versions:-

4,25
https://codepen.io/leevers/pen/BaVOeaa

4.23
https://codepen.io/leevers/pen/gOKdJOV

0 Kudos
GreteSoosalu
Esri Contributor

Oh, I see what you mean now, we'll look into it. Thanks for reporting it!

GreteSoosalu
Esri Contributor

Just a quick update: this issue will be fixed in version 4.26 which is expected to be released at the end of February.