This project has moved and is read-only. For the latest updates, please go here.

Bezier Line

Feb 13, 2015 at 12:27 PM
Is it possible to draw a bezier curve bewteen to coordinates on the map.
Feb 13, 2015 at 1:07 PM
Edited Feb 13, 2015 at 1: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())
        map.MapTransform.Transform(new Location(54.0, 7.5)),
        false, false);
        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 2:54 PM
Edited Feb 13, 2015 at 2:55 PM
Thanks here's the desire result using CartoDB Map