How to add AsyncShapeFileReader to MapShapeDataVirtualizationSource at runtime.

5 posts, 1 answers
  1. Sanjay
    Sanjay avatar
    21 posts
    Member since:
    Jun 2014

    Posted 21 Jan 2015 Link to this post

    Hi There

    1. Can you share C# code for implementing VisualizationLayer.VirtualizationSource ,i.e I wish to create Virtualization layer object at runtime, define and add MapShapeDataVirtualizationSource AsyncShapeFileReader  in MapShapeDataVirtualizationSource, and 
    setting its source to URI shapefile.

    2. How many Virtualization layers can i add to radMap.

    3. What is the maximum size of shapefile in MB which radMap WPF engine can render without UI responsive issue.

    4. I have some 3000 shapefiles of size less than 5 KB.Should i add them all in one Virtualization layer or can load each of them in individual Virtualization layers.Kindly advice.

    Thanks In Anticipation.
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 23 Jan 2015 Link to this post

    Hi Sanjay,

    Straight to your questions.

               --) I am adding a project here and I hope it can be a good starting point for you.
       --) You can add many layers but I think you should add more than one if you have a good reason for that. For example you need to clear particular layer holding particular types of objects. We have two layers in our Routing demo - one layer for the Route Points, and one layer for the animation. These layers are both logically and physically separated. We need also to clear the route points. Adding several layers does not improve the performance actually.
       3 / 4) Single Layer with multiple AsyncReaders should do the job. However, it is not the size of the shape files that matters most. It is the number of points the map will process. If you have thousands of points you can consider simplifying the shape objects with some tools and also virtualization is almost mandatory to speed up the zoom and pan operation. 

    Regards,
    Petar Mladenov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Sanjay
    Sanjay avatar
    21 posts
    Member since:
    Jun 2014

    Posted 27 Jan 2015 in reply to Petar Mladenov Link to this post

    Hi Petar ,

    Thanks for the sample project,it works for me, I have some follow up queries below.

    1. In sample project you have VirtualizationLayer at compile time and its VirtualizationSource is set to StaticResource of class type which implements IMapItemsVirtualizationSource.So essentially one VirtualizationSource  class for each VirtualizationLayer. If I add more VirtualizationLayer i should create VirtualizationSource  class for each layer respectively?

    2.Can I avoid creating VirtualizationSource class if i can set ZoomLevelGrid for layers.

    <telerik:VisualizationLayer.ZoomLevelGridList>
                            <telerik:ZoomLevelGrid MinZoom="8" />
                            <telerik:ZoomLevelGrid MinZoom="9" />
                            <telerik:ZoomLevelGrid MinZoom="10" />

    What will happen if I set ZoomLevel below 8, i.e
    <telerik:ZoomLevelGrid MinZoom="3" />
     
    Here I'm demanding that data still be visible on the low zoom levels (1 – 7). So is it that for data to be visible at lower zoom level (1-7) i need to create custom virtualization source class and for above than 8,I don't?

    3. Can you suggest C# equivalent for XAML below, without using resource type.
    VirtualizationSource="{StaticResource VirtualizationSource}"


    Thanks In Anticipation
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 28 Jan 2015 Link to this post

    Hi Sanjay,

    1) Yes you can set VirtualizationSource to every Visualization Layer. However, we can suggest you to minimize the layers. If you can implement your scenario with single layer - do it, otherwise the WPF visual tree is getting more complicated and this might lead to performance issues.

    2) I hope this question is answered to you in the other thread here.
    http://www.telerik.com/forums/shapefile-taking-too-long-to-load

    3) Yes, an erquivalent could be:
    this.visualizationlayer.VirtualizationSource = new ShapeDataVirtualizer();


    Regards,
    Petar Mladenov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 28 Jan 2015 Link to this post

    Hi Sanjay,

    1) Yes you can set VirtualizationSource to every Visualization Layer. However, we can suggest you to minimize the layers. If you can implement your scenario with single layer - do it, otherwise the WPF visual tree is getting more complicated and this might lead to performance issues.

    2) I hope this question is answered to you in the other thread here.
    http://www.telerik.com/forums/shapefile-taking-too-long-to-load

    3) Yes, an erquivalent could be:
    this.visualizationlayer.VirtualizationSource = new ShapeDataVirtualizer();


    Regards,
    Petar Mladenov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready