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

Switching from Clustered Data Source to Items Data Source

2 Answers 11 Views
Map
This is a migrated thread and some comments may be shown as answers.
BOARD LAB
Top achievements
Rank 1
BOARD LAB asked on 26 Nov 2013, 09:12 AM
I'm trying to give the ability to the user to change between two modes ( with/without clustering). Right now I'm "nulling" the itemtemplate and removing the datamappings. what is the best and clean way to achieve this ?

ObservableCollection<MapItem> _dataItems = this.GetMapData();
 if (MapConfigurationProperties.IsClusteringEnabled)
 {
    this.informationLayer.DataMappings.RemoveAll();
    this.informationLayer.ItemTemplate = null;
    this.informationLayer.ClusteredDataSource = _dataSource;
 }
else
{
    this.informationLayer.ClusteredDataSource = null;
    this.informationLayer.ItemTemplate = this.radMap.Resources["itemTemplate"] as DataTemplate;
    this.informationLayer.DataMappings.Add(new DataMapping("Location", DataMember.Location));
    this.informationLayer.DataMappings.Add(new DataMapping("BaseZoomLevel",
                                           DataMember.ZoomLevel));
    this.informationLayer.DataMappings.Add(new DataMapping("ZoomRange", DataMember.ZoomRange));
    this.informationLayer.ItemsSource = _dataItems;
}

One strage thing that happen swithing from one mode to another is that the points one the map are translated despide the fact the the underline data are unchanged.



2 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 26 Nov 2013, 04:02 PM
Hi Simone,

Unfortunately we're not sure what to advice you without having a closer look at your implementation.

Could you, please, open a support ticket and provide us with your solution or with a small sample solution which reproduces it? This will enable us to better understand your approach and advice you how to proceed with it.

Thank you in advance.

Regards,
Andrey Murzov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.

Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.

Sign up for Free application insights >>
0
BOARD LAB
Top achievements
Rank 1
answered on 28 Nov 2013, 07:33 AM
Hi Andrey,
I solved the problem, it was simply that I've provided zoomrange and basezoom in only the item data source and not in the clustered data source.

Thanks anyway
Tags
Map
Asked by
BOARD LAB
Top achievements
Rank 1
Answers by
Andrey
Telerik team
BOARD LAB
Top achievements
Rank 1
Share this question
or