This is a migrated thread and some comments may be shown as answers.

RadMap img download progress

1 Answer 69 Views
Map
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 12 Oct 2017, 04:14 AM

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

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 16 Oct 2017, 12:13 PM
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.
Tags
Map
Asked by
Richard
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or