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

SetZoomRange of PolylineData

12 Answers 84 Views
Map
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 2
Andrew asked on 31 Jul 2014, 10:57 PM
How do I set the Zoom Range of a PolylineData that it being used on the VisualizationLayer?

Andrew

12 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 01 Aug 2014, 05:36 AM
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.
 
0
Andrew
Top achievements
Rank 2
answered on 01 Aug 2014, 08:48 AM
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
0
Andrey
Telerik team
answered on 04 Aug 2014, 06:04 AM
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.
 
0
Andrew
Top achievements
Rank 2
answered on 04 Aug 2014, 08:28 AM
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.
0
Andrey
Telerik team
answered on 04 Aug 2014, 01:04 PM
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.
 
0
Andrew
Top achievements
Rank 2
answered on 11 Aug 2014, 09:44 PM
Andrey
the link you provided does not work.

Andrew
0
Andrew
Top achievements
Rank 2
answered on 11 Aug 2014, 11:44 PM
Can you provide some example code demonstrating virtualisation of Polyline objects with the new visualisation layer?
0
Andrey
Telerik team
answered on 12 Aug 2014, 06:08 AM
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.
 
0
Andrew
Top achievements
Rank 2
answered on 15 Aug 2014, 09:32 AM
Where can I download the example app from that page?

Andrew
0
Andrey
Telerik team
answered on 15 Aug 2014, 10:41 AM
Hi Andrew,

I have attached a sample solution.
I hope it helps.

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.
 
0
Andrew
Top achievements
Rank 2
answered on 15 Aug 2014, 05:13 PM
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.
0
Andrey
Telerik team
answered on 19 Aug 2014, 10:46 AM
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.
 
Tags
Map
Asked by
Andrew
Top achievements
Rank 2
Answers by
Andrey
Telerik team
Andrew
Top achievements
Rank 2
Share this question
or