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

Changing location of MapItem on visualizationlayer with ClusteringEnabled

3 Answers 40 Views
Map
This is a migrated thread and some comments may be shown as answers.
Nickolay
Top achievements
Rank 1
Nickolay asked on 17 Feb 2014, 09:04 PM
Hi! When i try to change location of my mapitem on vizualizationlayer with clustering it disappears from map. While zooming, when virtualization starts work, item appears again. With ClusteringEnabled == false everything works fine as expected. What i should refresh with ClusteringEnabled === true to avoid dissapearing items.
My map xaml.
<telerik:RadMap Name="MainMap" Provider="{Binding MapProvider}" Grid.Row="0"  
    MouseClickMode="None" MouseDoubleClickMode="None">
    <telerik:VisualizationLayer Name="PoiVisualizationLayer"
        ItemTemplate="{StaticResource ClusteredItemTemplate}"
        ClusterItemTemplate="{StaticResource ClusterTemplate}"
        AutoCalculateClusteringThreshold="False"
        ClusteringEnabledThreshold="18"
        ClusteringEnabled="True"
        VirtualizationSource="{Binding}">
     <telerik:VisualizationLayer.ZoomLevelGridList>
                    <telerik:ZoomLevelGrid MinZoom="1" />
                    <telerik:ZoomLevelGrid MinZoom="2" />
                    <telerik:ZoomLevelGrid MinZoom="3" />
                    <telerik:ZoomLevelGrid MinZoom="4" />
                    <telerik:ZoomLevelGrid MinZoom="5" />
                    <telerik:ZoomLevelGrid MinZoom="6" />
                    <telerik:ZoomLevelGrid MinZoom="7" />
                    <telerik:ZoomLevelGrid MinZoom="8" />
                    <telerik:ZoomLevelGrid MinZoom="9" />
                    <telerik:ZoomLevelGrid MinZoom="10" />
                    <telerik:ZoomLevelGrid MinZoom="11" />
                    <telerik:ZoomLevelGrid MinZoom="12" />
                    <telerik:ZoomLevelGrid MinZoom="13" />
                    <telerik:ZoomLevelGrid MinZoom="14" />
                    <telerik:ZoomLevelGrid MinZoom="15" />
                    <telerik:ZoomLevelGrid MinZoom="16" />
                    <telerik:ZoomLevelGrid MinZoom="17" />
                    <telerik:ZoomLevelGrid MinZoom="18" />
                    <telerik:ZoomLevelGrid MinZoom="19" />
                    <telerik:ZoomLevelGrid MinZoom="20" />
                </telerik:VisualizationLayer.ZoomLevelGridList>
            </telerik:VisualizationLayer>
        </telerik:RadMap>

MapItem extends ViewModelBase. It contains Location property. MainPage.DataContext == MainViewModel implements IMapItemsVirtualizationSource.

3 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 18 Feb 2014, 11:27 AM
Hello Nickolay,

Unfortunately we can't reproduce this issue using only the code snippet you provided us with. Could you, please, provide us with a small sample solution which reproduces it? This will allow us to further investigate the case and help you move forward with your implementation.

Regards,
Andrey Murzov
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

0
Nickolay
Top achievements
Rank 1
answered on 18 Feb 2014, 05:23 PM
Hello Andrey, 
Here small sample solution -
https://www.dropbox.com/s/4f2ltw7tf7xh0b2/ClusteringProblemSlApp.rar
0
Andrey
Telerik team
answered on 20 Feb 2014, 06:19 PM
Hi Nickolay,

Thank you for the sample solution.

We were able to reproduce the problem with it. Therefore we created an item in our feedback portal and you track its status here.

In the meantime, as workaround you can use the VisualizationLayer.RefreshVirtualSource() method. It refreshes the layer which uses the VirtualizationSource.

Also you should invoke the VisualizationLayer.ArrangeItem() method when the location is updated, because the change of the location would not affect the items which are inside a cluster. You don't have to invoke that method when you refresh the whole layer using the RefreshVirtualSource() method, but you will need to do it when the fix is available.

Regards,
Andrey Murzov
Telerik

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