This is a migrated thread and some comments may be shown as answers.

Polylines in RadMap

1 Answer 111 Views
Map
This is a migrated thread and some comments may be shown as answers.
Sonia
Top achievements
Rank 1
Sonia asked on 15 Mar 2012, 11:55 AM

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.

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 20 Mar 2012, 09:10 AM
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 >>
Tags
Map
Asked by
Sonia
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or