Control that acts like a layer.

4 posts, 0 answers
  1. Clint Singer
    Clint Singer avatar
    133 posts
    Member since:
    Oct 2012

    Posted 24 Feb 2010 Link to this post

    Hi,

    I need to make an object which draws on the map; in this case a polyline and an ellipse at each vertex on the polyline.  Where each vertex is represented by a Location value. 

    If I have a layer I can add all the items as individual elements and they will render fine.  I would like to be able to combine these into a single entity/control where the polyline and points are contained together on the layer so as far as the layer is concerned there is only one item on it even though it consists of many parts.  Additionally since I would be dealing with a control I could put logic in it related to the interaction of the geometries in the control.  Thereby allowing me to put many controls on the single layer that don't conflict with each other.

    I would prefer to do this without creating multiple layers.  Otherwise I would have to dynamically create and destroy layers to contain all of the geometry items into one single entity.

    Any suggestions?

    Cheers,
    Clint
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 01 Mar 2010 Link to this post

    Hi Clint,

    You can use MapPath shape. It is right what you need. It allows combining many map-relative geometries in one control. It operates similar to the Silverlight Path control way. RadMap provides analogs for most of the Silverlight geometries and segments, so you could create arbitrary path shape with lines, ellipses, polygons, arcs, and so on. MapPath also allows you having many figures in one shape.

    All the best,
    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.
  3. DevCraft banner
  4. Clint Singer
    Clint Singer avatar
    133 posts
    Member since:
    Oct 2012

    Posted 03 Mar 2010 Link to this post

    Hi,

    I was wondering if you would help me with MapEllipse.  How does one create a MapEllipse where the center of it specfies the location of the ellipse.  From what I can tell it uses a TopLeft and width (in km) representation.

    Cheers,
    Clint
  5. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 05 Mar 2010 Link to this post

    Hi Clint,

    There is the GetLatitudeLongitudeSize method in the RadMap that calculates degree size an object according to its location and size.
    You can use the following sample method that creates the MapEllipse by center and size using this functionality:
    private MapEllipse CreateMapEllipseByCenter(Location center, double width, double height)
    {
        MapEllipse ellipse = new MapEllipse();
        ellipse.Width = width;
        ellipse.Height = height;
        Size degreeSize = radMap.GetLatitudeLongitudeSize(center, width, height);
        Location location = new Location(center.Latitude + degreeSize.Height / 2d,
            center.Longitude - degreeSize.Width / 2d);
        MapLayer.SetLocation(ellipse, location);
        return ellipse;
    }

    All the best,
    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