Select to view content in your preferred language

Inaccurate X/Y Coordinates from mapView.toScreen() after Panning to Distant Locations

521
0
10-31-2023 04:17 AM
orahlagi
Occasional Contributor

Hello,

I am encountering an issue with the mapView.toScreen() method in the JavaScript API. Specifically, the problem arises when converting a Graphic's geographical coordinates to screen coordinates to display a custom popup.

Everything works as expected when I first load the map and use mapView.toScreen() to get the X/Y coordinates for the popup. However, when I pan the map to a faraway location and attempt to open a popup there using the same  method, the returned X/Y coordinates do not seem to correspond accurately to the actual location of the Graphic.

To summarize, the X/Y values are correct when the map is freshly loaded or when I am dealing with Graphics near the initial map view. But after scrolling a significant distance away, the coordinates returned by mapView.toScreen() seem to be abnormal and misaligned.

Has anyone encountered a similar issue, or is this a known bug? I'd appreciate any guidance you can provide on this.

Thank you.

0 Kudos
0 Replies