Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1230
xamGeographicMap persisting current view and reloading back to original view and zoom
posted

Hi,

We are using the GetGeographicFromZoom(xamGeoMap.ActualWindowRect) to get the current geographic view and zoom and then persist this view.

When the user re-opens the Map, we need to Zoom back to the original view the user had.

To do this we use:

xamGeoMap.WindowRect = xamGeoMap.GetZoomFromGeographic(Settings.WindowRect); // Settings.WindowsRect being the rect we got from GetGeographicFromZoom as above.

This works to a certain extend, except that the Zoom is slightly zoomed out further than saved.

The map is center, but slightly zoomed out further than when we saved the current rect.

Are we approaching this incorrectly? Are we using the correct methods to persist and restore the viewport on the map?

Please advise urgently...

Parents
  • 29105
    Offline posted

    Hello,

    Thank you for following up. I would assume you are handling this as expected. However since the zoom is slightly different I would imagine the Rect also differs before and after persisting and loading. I would try using the GetZoomRectFromGeoRect method to identify the changes to the Rect and make adjustments accordingly. In addition you may want to try calling the map's UseFixAspectZoom property to see if it helps.

    Please provide a sample that demonstrates the issue and I'll investigate this further with you.

    Let me know if you a have any questions.

Reply Children