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

InformationLayer Not Clearing

1 Answer 53 Views
Map
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 14 Oct 2011, 02:45 AM
I have an InformationLayer that contains points through a LocationCollection property in a view model. When I call the Clear() method on the LocationCollection, the lines on the map don't go away (even if I zoom in or out). My InformationLayer XAML looks like the following. As mentioned, MyPolyline is a LocationCollection:

<telerik:InformationLayer>
    <telerik:MapPolyline Points="{Binding MyPolyline}" Fill="Transparent" Stroke="Teal" StrokeThickness="1" />
</telerik:InformationLayer>

It appears I'm running version 2011.2.920.40. I have confirmed the MyPolyline.Count property is 0 after calling the Clear() method, but as mentioned, the lines on the map don't go away.

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 18 Oct 2011, 01:57 PM
Hello Sean,

This is known issue with ObservableCollection in WPF. The Clear method don't raise "collection changed" event. Please, use our extension method RemoveAll instead. For example:

this.model.Polyline.RemoveAll();


Kind regards,
Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Map
Asked by
Sean
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or