2 posts, 0 answers
  1. Trey
    Trey avatar
    1 posts
    Member since:
    Dec 2011

    Posted 06 May 2014 Link to this post


    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
  2. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1237 posts

    Posted 09 May 2014 Link to this post

    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.

    Pavel R. Pavlov
    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.
Back to Top