On Mon, 22 Feb 2010 11:03:29 +0100
Chris Browet <[email protected]> wrote:
Hi there,
> There isn't such a thing right now but you can add an enhancement
> request in Trac.
There is some code that could/should encode the speed in the width
of the track. Not sure why this isn't working anymore:
static void configurePen(QPen & pen, double slope, double speed)
{
// Encode speed in width of path ...
double penWidth = 1.0;
if (speed > 10.0)
penWidth = qMin(1.0+speed*0.02, 5.0);
// ... and slope in the color
int green = 0;
int red = 0;
if (slope > 2.0)
{
slope = qMin(slope, 20.0);
green = 48 + int(slope*79.0 / 20.0);
}
else if (slope < -2.0)
{
slope = qMax(slope, - 20.0);
red = 48 + int(-slope*79.0 / 20.0);
}
pen.setColor(QColor(128 + red, 128 + green, 128));
pen.setStyle(Qt::DotLine);
pen.setWidthF(penWidth);
}
_______________________________________________
Merkaartor mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/merkaartor