none
Stop Map control to download data

    Question

  • I'm experiencing the following issue with my app:

    I have a page with a Map Control. User can access this page through a previous "menu" page, then he can go back to it by pressing the back arrow... Classic.

    There is a problem regarding the maps data transferred to the Control: if the user taps on the back arrow, it must wait a certain amount of seconds before continue, probably because the Map must finish to download some data.

    I'm pretty sure of this because I've tried under two types of wireless connection:

    - when using a fast connection, like Wi-Fi, this amount of time is imperceptible.
    - when using cellular network, the time may vary even up to 10 seconds!

    Hence, how can I stop the map to download data inside the OnNavigatedFrom method? I see the property Map.IsDownloading but it's only a control flag. Any ideas?


    Alessandro Francesconi http://www.alessandrofrancesconi.it

    Sunday, July 28, 2013 11:32 AM

All replies

  • Don't load the map into the control tree unless it meets some parameter, or until you're on the page for 2-3 seconds.


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, July 29, 2013 4:11 PM
    Moderator
  • Thanks but, if I've understood your answer, it doesn't help me...

    I can't implement a "delayed loading" of the Map because it is the principal element of the Page... The user must see it right after the Page load.

    There are times in which the user opens the Page, the Map starts fetching data from the network, but after 3-4 seconds the user wants to return back to the previous page. Here, the Map data are not totally downloaded and the user must wait.


    Alessandro Francesconi http://www.alessandrofrancesconi.it

    Tuesday, July 30, 2013 8:32 AM
  • Have you tried disabling the Map control?


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, July 31, 2013 1:53 PM
    Moderator
  • If this is from the Bing Maps Map control, I have seen this issue as well with no solution.  It seems to happen when the map tiles should be updating, but there is no reliable network connection even though the phone believes one exists.  (Cellular data mode enabled with a bad network connection, for example.)  Disabling the Map control would only disable the user's access to the map control and not the downloads behind.  In my case, I could wait nearly 30 seconds to leave the page with the map control.  I started a thread on this issue probably around a year ago and found no solution, but I had more details on what was happening and, I believe, some sample code.
    Wednesday, July 31, 2013 2:26 PM