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...
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.
I have tried your suggestion, but when re-applying the saved rect using the above suggestion, then map is still zoomed out a little more than the rect I saved from using the GetGeographicFromZoom(xamGeoMap.ActualWindowRect) method.
UseFixedAspectZoom method had no affect.
I'm sure that someone must know how to persist and reload a certain area and zoom?? Has no one done this before?
Hello Key360,
I have created a private case for you, starting with 186803. You could reach your case following the link bellow:
https://ko.infragistics.com/my-account/support-activity I will update you via the mentioned case, so if you have any further questions or comments please update your case.
After reviewing this issue it has come to our attention that you should be saving xamGeoMap.ActualWindowRect property (not xamGeoMap.WindowRect) in the MapView and then setting it back to xamGeoMap.WindowRect property when you wish to load previsusly saved map view. Using GetGeographicFromZoom and then GetZoomFromGeographic method will not result in excacly the same window rect. Let me know if you have any questions.
Sincerely,
Michael Di FilippoAssociate Software DeveloperInfragistics, Inc.www.infragistics.com/support
We tried all possible approaches as well as the one above. BUT, time is money and this control is not worth the effort.
Your suggestion ALMOST works, however, the zoom changes every time we restore the graph.
We went with an alternate provider which actually restores previous locations and zoom level perfectly.
Thanks for the effort though, maybe this will help someone else in the near future.