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

Add item to VisualizationLayer.ItemsSource when zoomed in doesn't place item where it should be.

2 Answers 17 Views
Map
This is a migrated thread and some comments may be shown as answers.
Aleksandar
Top achievements
Rank 1
Iron
Aleksandar asked on 13 Jul 2016, 08:33 PM

If I add an item to an ObservableCollection that's already been bound to the VisualizationLayer.ItemsSource, the item won't appear on the map where it should. Instead, it displays the item at lat:0, long:0 in the middle of the map. This happens when the map is zoomed in and you add an item. 

Interestingly, if I first zoom the map out to the world view and then add the item, the item appears where it should. It's almost like RadMap needs the middle of the map (0,0) to be visible for new items to get displayed in the correct location.

Steps to reproduce:

1. Create an ObservableCollection with some items and set it to the VisualizationLayer.ItemsSource.

2. Zoom in somewhere so the middle of the map (0,0) is not visible. A local city works fine.

3. Add an item to the ObservableCollection.

Result: The item won't appear where it should on the map, instead it appears at 0,0 which you can see when you zoom out.

2 Answers, 1 is accepted

Sort by
0
Aleksandar
Top achievements
Rank 1
Iron
answered on 13 Jul 2016, 08:42 PM
Not sure if it matters but I'm using the BingRestMapProvider.
0
Aleksandar
Top achievements
Rank 1
Iron
answered on 14 Jul 2016, 07:59 PM
I think my issue has been resolved. I was using an IValueConverter to convert my GeoPoint to a Telerik Map.Location in markup. It seems like the converter always defaulted to an empty value first, before setting the actual value. The fix is kind of a hack, but I basically added a wrapper Telerik Map.Location property to my model and then bound to that.
Tags
Map
Asked by
Aleksandar
Top achievements
Rank 1
Iron
Answers by
Aleksandar
Top achievements
Rank 1
Iron
Share this question
or