Z value incorrect at certain zoom level

2872
2
06-09-2016 08:40 AM
DougCollins
Occasional Contributor

I have been working with the latest Javascript API 4.0, and have noticed that when you launch the web page and click to get a z value, it is incorrect depending on your initial zoom level.   If you set the zoom level at 7 or less (or about 1:4,000,000), the z value of a point is incorrect, but if the zoom level is at 8 or higher, then it is correct.  Also, if you launch the web page with a zoom level of 7 or less, and zoom in by one level (ie. to 8), then back out to 7, it reports the correct z value.  It seems that it depends on the initial zoom level when starting the application.  Is this a bug?

Sample code is attached.

Thanks,

Charlie

0 Kudos
2 Replies
KristianEkenes
Esri Regular Contributor

Hi Charlie,

This is a known issue that probably won't change anytime soon as far as I know. The reason you're seeing this behavior is because the SceneView doesn't load the elevation layer referenced in the Map's ground property until the user or the application zooms to or beyond the level you observed ( levels >8 ). This is for performance reasons. When zoomed out passed level 8 ( levels <8 ), it is less likely that elevation will be needed or used by the user. Once you zoom in passed that level, then it loads because it will start to have a visible impact in the scene. We don't load elevation when zoomed out passed level 8 because the extra loading in the app seems to be unnecessary.

The reason you're seeing correct values after zooming to 8 then back to level 7 or lower is because the elevation layer is already loaded, whereas it wasn't when the application initially loaded. I hope that makes sense. As stated above, I don't see this changing soon unless we become aware of use cases where the user needs elevation values at those levels. Was is your use case? I can share it with others on the team so we can reassess this issue.

0 Kudos
DougCollins
Occasional Contributor

Thanks Kristian.

Now that I know the reasoning behind it, I will adjust accordingly.  Thanks for the information.

Charlie

0 Kudos