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

Control that acts like a layer.

3 Answers 75 Views
Map
This is a migrated thread and some comments may be shown as answers.
Clint Singer
Top achievements
Rank 1
Clint Singer asked on 25 Feb 2010, 05:48 AM
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

3 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 01 Mar 2010, 11:07 AM
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.
0
Clint Singer
Top achievements
Rank 1
answered on 03 Mar 2010, 05:31 PM
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
0
Andrey
Telerik team
answered on 05 Mar 2010, 12:40 PM
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.
Tags
Map
Asked by
Clint Singer
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Clint Singer
Top achievements
Rank 1
Share this question
or