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

visualizationlayer

1 Answer 97 Views
Map
This is a migrated thread and some comments may be shown as answers.
Trey
Top achievements
Rank 1
Trey asked on 06 May 2014, 12:46 PM
Hello.


I have a sql server Table which contains some geometry data ( about 150 points), a column  with the color to applied on these points, and a label.

I need to display these points on my map with the right color and the corresponding label.

I'm new in WPF and telerik objects. If you can explain to me what object I should use (MapPinPoint, MapEllipse. i am lost with your different points objects. And i don't see how I can change the color of a particular point in code behind

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 09 May 2014, 07:32 AM
Hi Trey,

Thank you for contacting us on that matter. I am happy to inform you that there is straightforward approach to achieve your requirement. You can try using the visualization layer in MVVM approach. I will try to explain what you need to do to implement such approach.

First you need to create a custom class (e.g. MapItem class) that will contain data from your database table (e.g. geometry, color, label...) as well as data that will be used by the RadMap control to visualize your business data (e.g. location).
Furthermore, you need to create a collection of such classes that will be used as ItemsSource of the visualization layer of the RadMap control. The next step will be to create a custom DataTemplate that will be used by the visualization layer to visualize your data. In that template you will be allowed to use data bindings to bind the properties exposed by your MapItems to properties of the controls used in the template. By doing so you will be able to control the visual appearance of your points by changing the properties of your MapItems. You can make these changes from your ViewModel or from code behind. You can find further explanations and code samples in our documentation.

Please try the approach described in the article out and let me know if you need any further assistance.

Regards,
Pavel R. Pavlov
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
Trey
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or