This project has moved. For the latest updates, please go here.

Bezier Line

Feb 13, 2015 at 11:27 AM
Is it possible to draw a bezier curve bewteen to coordinates on the map.
Coordinator
Feb 13, 2015 at 12:07 PM
Edited Feb 13, 2015 at 12:08 PM
Yes, use a MapPath and put e.g. a StreamGeometry in its Data property. The important thing is to create a Geometry with projected coordinates, like
var geo = new StreamGeometry();
using (var gc = geo.Open())
{
    gc.BeginFigure(
        map.MapTransform.Transform(new Location(54.0, 7.5)),
        false, false);
    gc.QuadraticBezierTo(
        map.MapTransform.Transform(new Location(54.5, 8.0)),
        map.MapTransform.Transform(new Location(54.0, 8.5)),
        true, false);
}
mapPath.Data = geo;
If you're looking for a Silverlight or WinRT solution, you'll have to apply the above to a QuadraticBezierSegment in a PathFigure.

The funny thing about this is that I am currently preparing a helper class that wraps a StreamGeometryContext to simplify things a bit.
Feb 13, 2015 at 1:54 PM
Edited Feb 13, 2015 at 1:55 PM
Thanks here's the desire result using CartoDB Map