Polylines in RadMap

2 posts, 0 answers
  1. Sonia
    Sonia avatar
    90 posts
    Member since:
    Mar 2012

    Posted 15 Mar 2012 Link to this post

    Hi,
    I draw a polyline in RadMap and i would like to set zoom range. I've tried this, but it does not work for me.

    MapPolyline polyline = new MapPolyline()
                {
                    Points = p,
                    Stroke = new SolidColorBrush(c),
                    StrokeThickness = 2,
                };
                 
    dynamicLayer.Items.Add(polyline);
                 
    MapLayer.SetZoomRange(polyline, new ZoomRange(14, 20));

    I also wanted the StrokeThickness grows with the zoom level. I've tried this, but it also does not work.

    MapLayer.SetBaseZoomLevel(polyline, 14);
    MapLayer.SetMaxScale(polyline, 3);
    MapLayer.SetMinScale(polyline, 2);

    Finally, i am drawing traffic status over the roads in a city. These are a lot of UI elements, and it's very very slow. How can i improve the performance. Could I hide some elements (polylines, etc) based on its visibility? i mean all the city may be is not been displayed at the same time.

    Thanks for your help.

  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 20 Mar 2012 Link to this post

    Hi Sonia,

    1. The BaseZoomLevel, MaxScale and MinScale properties doesn't work for mape shape objects. Actually these properties don't have any sense for map shape objects because they use geographical coordinates and sizes and are scalable by itself.

    2. I'm not sure what type of dynamicLayer variable has, but if it is of DynamicLayer type, then you must not use its Items property directly.

    3. ZoomRange property will work for map shape objects in the 2012.Q1 SP1.

    4. To increase the performance of your application I would recommend that you use the DynamicLayer.  

    Kind regards,
    Andrey Murzov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
Back to Top