Select to view content in your preferred language

When to call MapView.LocationToScreen()

980
2
08-14-2019 07:02 AM
AlexanderLippling
Emerging Contributor

Hi!

Is there an event/property I can use to determine when functions like LocationToScreen() can be called? I noticed that I have to wait several hundred milliseconds until this function doesn't return (NaN, NaN).

-Alexander

0 Kudos
2 Replies
dotMorten_esri
Esri Notable Contributor

Wait for the VisibleArea or SpatialReference property on the view has been established. You could also wait for the first ViewpointChanged event.

0 Kudos
AlexanderLippling
Emerging Contributor

Hi Morten,

thanks. Waiting only for SpatialReference != null doesn't work, but waiting for VisibleArea != null seems to work.

-Alexander

0 Kudos