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

How to Add zoomrange and style to Polylinedata dynamically

1 Answer 128 Views
Map
This is a migrated thread and some comments may be shown as answers.
Sanjay
Top achievements
Rank 1
Sanjay asked on 20 Jan 2015, 01:11 PM
Hi There

1. With InformationLayer Map Shape, MapPolyLine i was able to set zoom range value and style dynamically, like code below, looking for equivalent code for PolyLineData.

This works;
MapPolyline polylinedata = new MapPolyline()            
            polylinedata.SetValue(MapLayer.ZoomRangeProperty, new ZoomRange(2, 9));
            polylinedata.SetValue(MapLayer.BaseZoomLevelProperty, 5);
            polylinedata.SetValue(MapLayer.MaxScaleProperty, 5);
            polyline.Style = this.Resources["selectedPolyLineStyle"] as Style;   

Code below doesn't work;
PolylineData polylinedata = new PolylineData();
           polylinedata.SetValue(MapLayer.ZoomRangeProperty, new ZoomRange(2, 9));
           polylinedata.SetValue(MapLayer.BaseZoomLevelProperty, 5);
           polylinedata.SetValue(MapLayer.MaxScaleProperty, 5);
           polyline.Style = this.Resources["selectedPolyLineStyle"] as Style;

2. I have some 3K PolylineData framework elements which I'm creating dynamically live above , adding each of them to VirtualizationLayer in loop.This is quick but the because of 3K pPolylineData the Zoom and Panning performance is degraded.Kindly suggest the right approach.

Thanks in Anticipation

Thanks in Anticipation

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 23 Jan 2015, 09:08 AM
Hello Sanjay,

Let me go straight to your questions.

1) In Visualization Layer, you can use these "MapLayer properties" on FrameworkElements - Ellipse, Rectangle Polyline, etc. Just like it is shown in the Visualization Layer Introduction help article. Also, you can set up these properties on elements in databinding scenarios - please have a look at this article.
However, Map Shape data objects (LineData, PolylineData, RectangleData, etc) are not dependency objects and the MapLayer proeprties cannot apply on them. You will need to use code behind and events for such behaviors like zoomrange.

2) As discussed in other ticket with you, you have to set up a VirtualizationSource for better performance.

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.

 
Tags
Map
Asked by
Sanjay
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or