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

change image of pinpoint in real time

3 Answers 123 Views
Map
This is a migrated thread and some comments may be shown as answers.
Yb
Top achievements
Rank 1
Yb asked on 04 Dec 2013, 03:31 PM
    Hello everyone, now I have put some pinpoints on the map(behind there are some custom objects named target), and I want the image of pinpoint to change  dynamically when some events occur, what should I do? Should I Use INotifyPropertyChanged or ObservableCollection (maybe this will not work because map will not refresh when image source property change)? Or should I not use pinpoint and instead use custom item directly?
    What's the best way to organize the items on map that can reflect the change of property(image) in real time? Thank you every much and wait for help! (Better If there are some sample codes)

3 Answers, 1 is accepted

Sort by
0
Yb
Top achievements
Rank 1
answered on 04 Dec 2013, 03:46 PM
  It' not easy to change image source property of pinpoint which is already on map.For property like location, we can simply use       MapLayer.SetLocation() to update its status without more efforts.
0
Accepted
Andrey
Telerik team
answered on 05 Dec 2013, 09:52 AM
Hi Yb,

I think the best approach to do it is using MVVM. You can bind your data item collection to the VisualizationLayer.ItemsSource property. And you can specify the appearance of the point via DataTemplate using the ItemTemplate property. Also you should implement the INotifyPropertyChanged interface in your data item class to allow to change the source of the Image using data binding.

I have attached a sample solution which implements this approach.

I hope it helps.

Regards,
Andrey Murzov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.

Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.

Sign up for Free application insights >>
0
Yb
Top achievements
Rank 1
answered on 06 Dec 2013, 02:43 AM
Hi, Andrey
Thank you very much! That's actually what I want! May you best wish.
Tags
Map
Asked by
Yb
Top achievements
Rank 1
Answers by
Yb
Top achievements
Rank 1
Andrey
Telerik team
Share this question
or