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?
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.
The workaround was not accurate at all.
We have decided to go with another provider
Thank you for following up.
I very much would like to debug your application. Please provide your code or a sample that reproduces the behavior and I'll investigate this with my team.
I can also confirm that this is an issue. You can even see it happen in the IG samples application in the favorites example you describe. Zoom to a location and click add to favorite and then you'll see that the map immediately zooms out a bit due to the recently added favorite becoming selected in the list.
I am also facing this issue as I need to save the current windowRect and re-apply it when users re-enter this map view. I haven't found a great workaround yet so any help would be appreciated.
-Chris
Hello Chris,
Thank you for contacting Infragistics. My team and I have reviewed the sample and we've determined that this is most likely an issue with the component and not the sample. At this time I have created a private case to follow up with you regarding my investigation.
I have created a private case for you, starting with ID 188089. You could reach your case following the link bellow:
https://www.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.