VisualizationLayer, Location.Empty, and updating

2 posts, 0 answers
  1. Alan
    Alan avatar
    9 posts
    Member since:
    Nov 2013

    Posted 31 Aug 2015 Link to this post

    I'd like to use the VisualizationLayer, in a geocoding application situation.  We start with a number of data objects that do not have lat/long data, then add that data, and ideally animate them as they appear on the map. 

    These data objects are in an observable collection, and are represented with the following data template:


    <DataTemplate x:Key="MyDataModelTemplate" DataType="{x:Type models:MyDataModel}">
                <Viewbox x:Name="PART_Shape"
                        <MultiBinding Converter="{StaticResource LatitudeLongitudeToLocationMultiConverter}">
                            <Binding Path="Latitude"/>
                            <Binding Path="Longitude"/>
                        <telerik:HotSpot X="0.5" Y="0.5"/>
                    <Ellipse Fill="DodgerBlue"
                             ToolTip="{Binding DisplayName}">

    The converter returns Location.Empty when the latitude ​or longitude are null (they are nullable doubles), otherwise it just returns the Telerik Location object that correspondes to those properties.


    Here's my problem:

    When a location moves from a valid location to another valid location, the ellipse moves accordingly based on the above binding.  But when a location changes from Location.Empty to a valid location, it does not immediately appear.  The user must change zoom levels in order for the location to appear.

    Is this a bug in the RadMap control or am I doing something wrong? 


    Thank you,


  2. Petar Mladenov
    Petar Mladenov avatar
    2882 posts

    Posted 03 Sep 2015 Link to this post

    Hello Alan,

    We are aware of this behavior in RadMap, you can consider this operation as not completely supported currently. However, there are two approaches you can use:

    - When you change the Location from Empty to non-empty, invoke in the code behind Visualizationlayer.ArrangeItem() method
    - In the ViewModel class - if you have such, you can implement the   Telerik.Windows.Controls.Map.INotifyLocationChanged interface like so:
    public class MapItem : INotifyPropertyChanged, INotifyLocationChanged

    Location Location
                    return this.location;
                    Location oldValue = this.location;
                    this.location = value;
                    if (this.LocationChanged != null)
                        this.LocationChanged(this, new LocationChangedEventArgs(oldValue, this.location));

    Petar Mladenov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top