Declined
Last Updated: 08 Aug 2014 12:18 by ADMIN
simone massaro
Created on: 03 Jul 2014 09:53
Category: UI for Silverlight
Type: Bug Report
1
AccessViolationException
Hello,

I have a problem with the RadMap component which leads the silverlight plugin to a crash.
Basically i'm changing periodically the center of the map using the "ZoomLevel" and the "Center" properties of the map and after a casual number of times the silverlight plugin crashes with an  "AccessViolationException"

In order to reproduce the issue is sufficient to create a project with a simple user control with the following XAML:

<UserControl x:Class="RadMapTest.Map"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
     
    <Grid x:Name="LayoutRoot" Background="White">
        <telerik:RadMap x:Name="MapControl" >
            <telerik:RadMap.Provider>
                <telerik:ArcGisMapProvider Mode="Aerial"  />
            </telerik:RadMap.Provider>
        </telerik:RadMap>
    </Grid>
</UserControl>


And the following code behind:

using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Threading;
 
namespace RadMapTest
{
    public partial class Map : UserControl
    {
        private bool zoomOut;
        private DispatcherTimer timer;
        private Random random;
 
        public Map()
        {
            this.zoomOut = true;
            this.timer = new DispatcherTimer();
            this.random = new Random(DateTime.Now.Second);
            InitializeComponent();
 
            this.Loaded += OnLoaded;
        }
 
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            this.timer.Interval = TimeSpan.FromMilliseconds(1000);
            this.timer.Tick += this.OnTick;
            this.timer.Start();
        }
 
        private void OnTick(object sender, EventArgs e)
        {
            this.MapControl.Center = new Telerik.Windows.Controls.Map.Location((random.NextDouble() * 180) - 90, (random.NextDouble() * 360) - 180);
            this.MapControl.ZoomLevel = zoomOut ? this.MapControl.MinZoomLevel : random.Next(this.MapControl.MinZoomLevel, this.MapControl.MaxZoomLevel);
 
            zoomOut = !zoomOut;
        }
    }
}

I was able to reproduce this issue with the Silverlight Q1 2014 and Silverlight Q2 2014.
Also I have tried both Bing and ArcGIS providers.

In the test i'm using a very short animation time (1 sec), but the problems persists also with longer timings (e.g. 45 sec).

Can you provide some help on this?
1 comment
ADMIN
Pavel R. Pavlov
Posted on: 08 Aug 2014 12:18
Hello Simone,

We have already discussed this scenario in our forum (http://www.telerik.com/forums/accessviolationexception-on-radmap)

Unfortunately, this behavior is out of our control as it is caused by the Silverlight MultiscaleImage component. 

We recommend avoiding such scenarios in your application.