Use of AsyncReaderSourceCollection with VirtualizationSource

7 posts, 1 answers
  1. Alice
    Alice avatar
    4 posts
    Member since:
    Oct 2013

    Posted 23 Jun 2014 Link to this post

    I'm experimenting with AsyncShapeFileReader using the provided example. It works as expected with AsyncShapeFileReader's Source and DataSource properties set. The only thing I wish to change in the example is to use AsyncReaderSourceCollection to asyncronously load multiple shape files and benefit UI Virtualization.

    01.<telerik:VisualizationLayer.VirtualizationSource>
    02.    <telerik:MapShapeDataVirtualizationSource>
    03.        <telerik:MapShapeDataVirtualizationSource.Reader>
    04.            <telerik:AsyncShapeFileReader x:Name="mapShapeDataReader">
    05.                <telerik:AsyncReaderSourceCollection>
    06.                    <telerik:AsyncReaderSource Source="/MyProject;component/Resources/myshape1.shp" DataSource="/MyProject;component/Resources/myshape1.dbf" />
    07.                    <telerik:AsyncReaderSource Source="/MyProject;component/Resources/myshape2.shp" DataSource="/MyProject;component/Resources/myshape2.dbf" />
    08.                </telerik:AsyncReaderSourceCollection>
    09.            </telerik:AsyncShapeFileReader>
    10.        </telerik:MapShapeDataVirtualizationSource.Reader>
    11.    </telerik:MapShapeDataVirtualizationSource>
    12.</telerik:VisualizationLayer.VirtualizationSource>


    Visualization layer displays only the last AsyncReaderSource (myshape2.shp), although ReadShapeDataCompleted is called twice without exception. I wonder is it possible to load multiple shapes asynchronously and benefit Items Virtualization?

  2. Answer
    Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 23 Jun 2014 Link to this post

    Hello Alice,

    You should set the MapShapeDataVirtualizationSource.ClearCache property to 'False' when you use the AsyncReaderSourceCollection.
    The sample code is below.
    <telerik:MapShapeDataVirtualizationSource ClearCache="False">
    ...
    </telerik:MapShapeDataVirtualizationSource>

    Regards,
    Andrey Murzov
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Alice
    Alice avatar
    4 posts
    Member since:
    Oct 2013

    Posted 24 Jun 2014 in reply to Andrey Link to this post

    thanks alot for help, problem solve
  5. brousouf
    brousouf avatar
    2 posts
    Member since:
    Apr 2014

    Posted 14 Oct 2014 in reply to Andrey Link to this post

    Hello,
    I'm trying to load many KML files from code behind. It works fine with one KML, but I'm not able to make it work with many of them, (loading from code behind, not in XAML).
    Thanks a lot
  6. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 15 Oct 2014 Link to this post

    Hi brousouf,

    Is it possible for you to open a new support ticket with more details about your scenario ? What type of Layer do you use ? Can you send us an isolated sample that we can better investigate? Thank you in advance for your cooperation.

    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.

     
  7. Sanjay
    Sanjay avatar
    21 posts
    Member since:
    Jun 2014

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

    Hi Petar

    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.

  8. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 23 Jan 2015 Link to this post

    Hi Sanjay,

    We answered these questions in the following forum thread.

    http://www.telerik.com/community/forums/how-to-add-asyncshapefilereader-to-mapshapedatavirtualizationsource-at-runtime

    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