RadMap img download progress

2 posts, 0 answers
  1. Richard
    Richard avatar
    1 posts
    Member since:
    Oct 2017

    Posted 11 Oct Link to this post

    Hi. I am using RadMap with a UriImageProvider to fetch a tile from a given URI. Is there a way to get a callback when the image from the URI has been downloaded? 

     

    Some images can be very large and slow to download in slower internet speeds. Currently I have no way to determine if the image is indeed downloading or not, or how long to wait for it to complete.

     

    Cheers

    Richard

  2. Dinko
    Admin
    Dinko avatar
    462 posts

    Posted 16 Oct Link to this post

    Hi Richard,

    Thank you for your interest in our RadMap control.

    The UriImageProvider doesn't expose such event/callback which can notify that the image from the URL is downloaded out of the box. Basically, our control is based on the MultiScaleImage control.  We use the Microsoft MultiScaleImage control for Silverlight version and we have its WPF implementation.

    What I can suggest you is to get the MultiScaleImage from the RadMap control and subscribe to its ImageOpenSucceeded event. To get the MultiScaleImage you can subscribe to the Loaded event of the RadMap control. In its handler, you can use our ChildrenOfType<T>() extension method to get the MultiScaleImage. Then you can subscribe to its ImageOpenSucceeded event. Check the following code snippet.
    private void xRadMap_Loaded(object sender, RoutedEventArgs e)
    {
        var map = sender as RadMap;
        var imageScale = map.ChildrenOfType<MultiScaleImage>().FirstOrDefault();
        if(imageScale != null)
        {
            imageScale.ImageOpenSucceeded += ImageScale_ImageOpenSucceeded;
        }
    }
     
    private void ImageScale_ImageOpenSucceeded(object sender, RoutedEventArgs e)
    {
         
    }

    Hope this information is helpful.

    Regards,
    Dinko
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top