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

3 posts, 0 answers
  1. Aleksandar
    Aleksandar avatar
    11 posts
    Member since:
    Nov 2012

    Posted 13 Jul Link to this post

    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. Aleksandar
    Aleksandar avatar
    11 posts
    Member since:
    Nov 2012

    Posted 13 Jul in reply to Aleksandar Link to this post

    Not sure if it matters but I'm using the BingRestMapProvider.
  3. DevCraft banner
  4. Aleksandar
    Aleksandar avatar
    11 posts
    Member since:
    Nov 2012

    Posted 14 Jul in reply to Aleksandar Link to this post

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