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 Reply
  • 29085
    Offline posted in reply to SSG Admin

    Hello,

    Please try performing the Flush method before attempting to change the WindowRect. Also, you may want to use WindowRect instead of ActualWindowRect when using the Get() methods on the map.

    Persisting views within the map is considered to be a new product idea. We have a sample that demonstrates how to store/load a WindowRect as a favorite "view" on the map that users can revisit. In the sample, each WindowRect is stored in an ObservableCollection of type MapView.

    Please use this link for more details: Mapping Geo-Regions

    If you are still having issues, please provide the logic in your application relevant to saving and loading the WindowRect and I'll do my best to provide you with a viable solution.

    You can suggest new product ideas for future versions by emailing ideas@infragistics.com
    Submitting your idea will send it directly to our product management team so that it can be imported into our new ideas community once live: http://ideas.infragistics.com

    Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case.  You can also link back to this thread for additional details.
    Thank you in advance to submitting your product idea.

    Let me know if you have any questions regarding this matter.

Children