Select to view content in your preferred language

Detect when map point is not visible on SceneView

197
2
Jump to solution
07-30-2024 07:30 PM
avecchi
New Contributor III

Hello,

I'm getting a map point in a SceneView using this function:

 

const mapPoint = view.toMap(screenPoint)

 

I'd like to know when this point becomes hidden by the globe when rotating. I've attached a gif to show what's happening currently

Untitled.gif

0 Kudos
1 Solution

Accepted Solutions
ArnoFiva
Esri Contributor

This is interesting, can you share a bit more about your use case? 

I haven't tried, but I would assume that for a given myPoint on the map, once view.toScreen() and a subsequent view.toMap() do not return the same point, it's behind the globe. Can you give it a try?

View solution in original post

0 Kudos
2 Replies
ArnoFiva
Esri Contributor

This is interesting, can you share a bit more about your use case? 

I haven't tried, but I would assume that for a given myPoint on the map, once view.toScreen() and a subsequent view.toMap() do not return the same point, it's behind the globe. Can you give it a try?

0 Kudos
avecchi
New Contributor III

This worked! Thanks! I will add, that the points are never exactly equal so I just made it so that if their coordinates differ by more than 5 degrees then it doesn't display it.

As for use case, I'm trying to render some html at a location that follows the map at a given coordinate. Is there an easier way to do this?