Question

I am working on an application using map on WP8 and I have to know when does the map stop scrolling so I can send my asynchronous requests to the webservice to get my data.

The only event handler I found which could correspond is ViewChanged but the problem is that it is called while the map is still moving, and I only want to send requests to my server when the user stops scrolling where he wants.

Has anyone encountered this problem and found a solution to it ?

Thank you

Was it helpful?

Solution

It should be fired only when the map has stopped changing that's why you have two different events: ViewChanging and ViewChanged.

See Maps events on the MSDN:

http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.maps.controls.map_events(v=vs.105).aspx

Additionnaly, you can also use CenterChanged and ZoomLevelChanged that should be fired when the view has been updated.

  • CenterChanged:

http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.maps.controls.map.centerchanged(v=vs.105).aspx

  • ViewChanged:

http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.maps.controls.map.zoomlevelchanged(v=vs.105).aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top