Error if DynamicLayer contains data

2 posts, 0 answers
  1. Manfred
    Manfred avatar
    53 posts
    Member since:
    Jan 2011

    Posted 28 Feb 2011 Link to this post

    Hi,

    i have some problems with the map:
    we have an application that integrates modules in the main site.
    We have a treeview on the left where we select items. If an item is selected, every module should show the corresponding data.
    If I start my application and select the map, everything is fine.
    But if selecting an other module (no matter which) select one or more items in my treeview and try to open the map, I got the following error:

    Zeile: 54
    Zeichen: 13
    Fehler: Unhandled Error in Silverlight Application
    Code: 4004   
    Category: ManagedRuntimeError      
    Message: System.InvalidOperationException: Der Vorgang wird bei schreibgeschützten Auflistungen nicht unterstützt.
       bei System.Windows.Controls.ItemCollection.ClearImpl()
       bei System.Windows.PresentationFrameworkCollection`1.Clear()
       bei Telerik.Windows.Controls.Map.DynamicLayer.ClearItems()
       bei Telerik.Windows.Controls.Map.DynamicLayer.Refresh()
       bei Telerik.Windows.Controls.Map.DynamicLayer.NewMapInitializeCompleted(Object sender, EventArgs e)
       bei System.EventHandler.Invoke(Object sender, EventArgs e)
       bei Telerik.Windows.Controls.RadMap.OnInitializeCompleted(EventArgs args)
       bei Telerik.Windows.Controls.RadMap.Initialize()
       bei Telerik.Windows.Controls.Map.TileLayer.ProviderInitializeCompleted(Object sender, EventArgs e)
       bei Telerik.Windows.Controls.Map.MapProviderBase.get_IsInitialized()
       bei Telerik.Windows.Controls.Map.OpenStreetMapSource.Initialize()
       bei Telerik.Windows.Controls.Map.TileLayer.ProviderMapModeChanged(Object sender, MapModeChangedEventArgs e)
       bei Telerik.Windows.Controls.Map.TileLayer.set_Source(MapProviderBase value)
       bei Telerik.Windows.Controls.RadMap.OnApplyTemplate()
       bei System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)     

    The next thing is, that the map window doesn't resize to the parent window, my xaml for the map is this:
    <telerik:RadMap VerticalAlignment="Stretch"
                        Height="Auto"
                        Width="Auto"
                        Name="radMap1"
                        HorizontalAlignment="Stretch"
                        MapMouseClick="radMap1_MapMouseClick">
        </telerik:RadMap>
     Any idea?
    If you need further information, please let me know.
    For a look th ethe application have a look to the attached pic.
    Best Regards
    Manfred
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 02 Mar 2011 Link to this post

    Hello Manfred,

    It looks like you are using the DynamicLayer in a wrong way. We can't reproduce the problem using approach which is described in the documentation. Could you, please, create a sample solution which demonstrates the problem and send it to us?

    The size of RadMap depends of its container. The RadMap control does not specify its default size when it is used inside a control like a panel. But according to its content it uses specified value of the defined width or height from its container (standard behavior of MS MultiscaleImage control).
    For example in the case with horizontal stack panel it gets specified value as a height and infinity as a width. When the control is measured then it specifies its width from the height value.

    Greetings,
    Andrey Murzov
    the Telerik team

    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. DevCraft banner
Back to Top