Changing location of MapItem on visualizationlayer with ClusteringEnabled

4 posts, 0 answers
  1. Nickolay
    Nickolay avatar
    2 posts
    Member since:
    Feb 2014

    Posted 17 Feb 2014 Link to this post

    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.
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 18 Feb 2014 Link to this post

    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).

  3. DevCraft banner
  4. Nickolay
    Nickolay avatar
    2 posts
    Member since:
    Feb 2014

    Posted 18 Feb 2014 in reply to Andrey Link to this post

  5. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 20 Feb 2014 Link to this post

    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

Back to Top