MapPolyLine and Ellipse with same location don't match

3 posts, 1 answers
  1. figueiredorj
    figueiredorj avatar
    68 posts
    Member since:
    Mar 2011

    Posted 17 Jun 2011 Link to this post


    I am trying with RadMap to trace a route on map.

    When drawing the MapPolyline all seems ok. However I am trying to draw shapes on start and on end of route and when doing so this shapes don't seem to be same location that points in line (althought I know they are).

    var lastGeo = geos.Last();
    var endEllipse = new MapEllipse()
        Location = lastGeo.Location,
        Width = 3,
        Height = 3,
        Fill = GetBrushFromHexString("#33FF33"),
        StrokeThickness = 2,
       Opacity = .5
    MapLayer.SetHotSpot(endEllipse, GetHotspot());
    box = new TextBlock();
    box.Text = temp.Location.ToString();
    MapLayer.SetHotSpot(box, GetHotspot());

    I also have changed HotSpot of ellipses to center it:
    private HotSpot GetHotspot()
        var hotspot = new HotSpot();
        hotspot.X = .5;
        hotspot.Y = .5;
        hotspot.XUnits = HotSpotUnit.Fraction;
        hotspot.YUnits = HotSpotUnit.Fraction;
        return hotspot;

    Also have seen someone complaining that using hotspot could be bugged and that latest night builds would have it fixed. Im my case this didn't happen.

    Is there some kind of procedure needed to set it right or am I doing something wrong?
    Please help.

  2. figueiredorj
    figueiredorj avatar
    68 posts
    Member since:
    Mar 2011

    Posted 20 Jun 2011 Link to this post

  3. DevCraft R3 2016 release webinar banner
  4. Answer
    Andrey avatar
    1681 posts

    Posted 21 Jun 2011 Link to this post


    It works as designed and problems with HotSpot have been fixed already. But HotSpot doesn't work for map shapes (MapEllipse is a map shape). Any map shape is strongly positioned by its coordinates. The MapEllipse.Location property set coordinates of the top-left corner of the ellipse (similar to the standard Ellipse shape). You can use MapPath with MapEllipseGeometry instead of MapEllipse. MapEllipseGeometry uses its center as object location. For example:

    private void AddEllipse(Location location)
        MapEllipseGeometry geometry = new MapEllipseGeometry()
            Center = location,
            RadiusY = 100,    // Miles or kilometers
            RadiusX = 100      // Miles or kilometers
        MapPath path = new MapPath()
            Fill = new SolidColorBrush(Colors.Blue),
            Data = geometry

    Andrey Murzov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
Back to Top