SetZoomRange of PolylineData

12 posts, 0 answers
  1. Andrew
    Andrew avatar
    27 posts
    Member since:
    Nov 2008

    Posted 31 Jul 2014 Link to this post

    How do I set the Zoom Range of a PolylineData that it being used on the VisualizationLayer?

    Andrew
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 01 Aug 2014 Link to this post

    Hello Andrew,

    The ZoomRange is not supported on the map shape data objects. I would recommend using the map shapes virtualization. You can find more details here.


    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. Andrew
    Andrew avatar
    27 posts
    Member since:
    Nov 2008

    Posted 01 Aug 2014 in reply to Andrey Link to this post

    I did try using Virtualization but was getting threading errors. Perhaps this was because I'm was trying to return MapPolyline objects. It sounds like I need to return PoylineData objects instead.

    Andrew
  5. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 04 Aug 2014 Link to this post

    Hi Andrew,

    There are 2 visualization engines in the RadMap package.

    The old implementation of the map objects' (points and shapes) visualization consists of 3 layers: InformationLayer, DynamicLayer and VirtualizationLayer.

    The new visualization engine replaces all 3 layers with the new VisualizationLayer.

    The MapPolyline object (like any other object inherited from the MapSрape class) is designed to be used with old engine (i.e. InformationLayer) and it can't be used with new engine (i.e. VisualizationLayer).

    New engine has own class hierarchy which represents map shapes: the data objects inherited from the MapShapeData class (LineData, PolylineData, PathData and so on). This is regular data objects (not a DependencyObjects) which can be created in the background thread. These classes do not support binding in anyway and can't be used in the data template.

    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.
     
  6. Andrew
    Andrew avatar
    27 posts
    Member since:
    Nov 2008

    Posted 04 Aug 2014 in reply to Andrey Link to this post

    Does the new VisualisationLayer internally support virtualisation? I have hundreds of thousands of polylines (each 1m long) and need to work out the best approach. I create two data sets, one containing the full 1m data set (visible with zoom > 18) and another visible at lower zoom levels with one polyline per 100m.
  7. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 04 Aug 2014 Link to this post

    Hello Andrew,

    Yes it is. For more details you can take a look at the Map Shapes Virtualization article.

    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.
     
  8. Andrew
    Andrew avatar
    27 posts
    Member since:
    Nov 2008

    Posted 11 Aug 2014 Link to this post

    Andrey
    the link you provided does not work.

    Andrew
  9. Andrew
    Andrew avatar
    27 posts
    Member since:
    Nov 2008

    Posted 11 Aug 2014 Link to this post

    Can you provide some example code demonstrating virtualisation of Polyline objects with the new visualisation layer?
  10. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 12 Aug 2014 Link to this post

    Hello Andrew,

    I'm sorry, the wrong link has been copied to the message. Use following link to read the article: http://www.telerik.com/help/wpf/radmap-features-visualization-layer-shapes-virtualization.html

    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.
     
  11. Andrew
    Andrew avatar
    27 posts
    Member since:
    Nov 2008

    Posted 15 Aug 2014 in reply to Andrey Link to this post

    Where can I download the example app from that page?

    Andrew
  12. Andrew
    Andrew avatar
    27 posts
    Member since:
    Nov 2008

    Posted 15 Aug 2014 in reply to Andrey Link to this post

    Ok, I've implemented the virtualization as per the example. In QueryItems I have code like this

    PolylineData pld = new PolylineData();
    pld.Points = new LocationCollection();
    pld.Points.Add(new Telerik.Windows.Controls.Map.Location(52.1865304892871, -0.146490724389641));
    pld.Points.Add(new Telerik.Windows.Controls.Map.Location(52.1867409774947, -0.153464467828342));
    shapes.Add(pld);

    Which works ok. How do I change the colour of the PolylineData. When I try and use

    pld.ShapeFill = new MapShapeFill()
    {
    Stroke = new SolidColorBrush(Colors.Red),
    StrokeThickness = 2
    };

    I get threading errors.
  13. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 19 Aug 2014 Link to this post

    Hello Andrew,

    The QueryItems method is invoked in the background thread, but the MapShapeFill class uses types which can be used in the UI thread only. So, in this case I would recommend you to use the MapShapeData.SerializedShapeFill property instead of using ShapeFill property.
    The sample code is below.

    PolylineData pld = new PolylineData();
    pld.Points = new LocationCollection();
    pld.Points.Add(new Telerik.Windows.Controls.Map.Location(52.1865304892871, -0.146490724389641));
    pld.Points.Add(new Telerik.Windows.Controls.Map.Location(52.1867409774947, -0.153464467828342));
    shapes.Add(pld);
     
    pld.SerializedShapeFill = new MapShapeDataFill()
    {
        StrokeColor = Colors.Red,
        StrokeThickness = 2
    };

    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.
     
Back to Top
UI for WPF is Visual Studio 2017 Ready