[Merkaartor] Patch updated: Enhance track visibility

Chris Browet cbro at semperpax.com
Mon Jul 6 00:49:12 BST 2009


My comments:

- I'd rather put the Preferences setting in "Visual"
- I'd put it under "Colors", with the possibility to change the track
segments color. Maybe besides "Background"...
- I'd rather call the setting "Alternate GPX track drawing" or something
like that (more neutral than "Enhanced")
- I'm a bit afraid that it is not obvious enough that it is not a plain
road, so that it could be confusing to new users. Don't you think some kind
of dashed lines would be better?

Otherwise, I agree that it makes tracks far easier to read.
OTOH, it makes working with the tracks downloaded from OSM completely
unusable in crowded areas. Some might argue (including me) that it was
already the case before, though.

Regards
- Chris -

2009/7/4 Yves Goergen <nospam.list at unclassified.de>

> Remember my old proposal to change the appearance of track lines from
> the dotted thin red/green line that almost gets lost in the map to a
> thicker solid blue (rare colour on maps) line that is easily visible?
> Last time my patch didn't have an option to switch it off. Now it has.
> And it's compatible with the current code, which has changed a bit since
> my last patch revision.
>
> See attached file. I'd be happy to commit it but like to hear your
> opinion first.
>
> Note that this patch enables the new appearance by default. I believe
> that the new appearance is better suited for new users. Anybody who
> doesn't like it can switch it off in the preferences, page "style".
>
> --
> Yves Goergen "LonelyPixel" <nospam.list at unclassified.de>
> Visit my web laboratory at http://beta.unclassified.de
>
> Index: src/Maps/TrackSegment.cpp
> ===================================================================
> --- src/Maps/TrackSegment.cpp   (revision 16293)
> +++ src/Maps/TrackSegment.cpp   (working copy)
> @@ -163,7 +163,7 @@
>                return;
>
>        const double DistFromCenter=10.0;
> -       const double theWidth=5.0;
> +       const double theWidth = !M_PREFS->getEnhanceTrackVisibility() ? 5.0
> : 8.0;
>        const double A = angle(FromF-ToF);
>
>        QPointF T(DistFromCenter*cos(A), DistFromCenter*sin(A));
> @@ -196,11 +196,24 @@
>                QPointF FromF(theView->toView(last));
>                QPointF ToF(theView->toView(here));
>
> -               const double distance = here.distanceFrom(last);
> -               const double slope = (p->Nodes[i]->elevation() -
> p->Nodes[i-1]->elevation()) / (distance * 10.0);
> -               const double speed = p->Nodes[i]->speed();
> +               if (!M_PREFS->getEnhanceTrackVisibility())
> +               {
> +                       const double distance = here.distanceFrom(last);
> +                       const double slope = (p->Nodes[i]->elevation() -
> p->Nodes[i-1]->elevation()) / (distance * 10.0);
> +                       const double speed = p->Nodes[i]->speed();
>
> -               configurePen(pen, slope, speed);
> +                       configurePen(pen, slope, speed);
> +               }
> +               else
> +               {
> +                       if (theView->pixelPerM() > 2)
> +                               pen.setWidthF(4.0);
> +                       else if (theView->pixelPerM() > 1)
> +                               pen.setWidthF(3.0);
> +                       else
> +                               pen.setWidthF(2.0);
> +                       pen.setColor(QColor(50, 220, 220));
> +               }
>                P.setPen(pen);
>
>                P.drawLine(FromF,ToF);
> Index: src/PaintStyle/EditPaintStyle.cpp
> ===================================================================
> --- src/PaintStyle/EditPaintStyle.cpp   (revision 16293)
> +++ src/PaintStyle/EditPaintStyle.cpp   (working copy)
> @@ -225,6 +225,9 @@
>        else if (!Pt->hasEditPainter()) {
>                if (p->isTrackPointVisible || (Pt->lastUpdated() ==
> MapFeature::Log && !p->isTrackSegmentVisible)) {
>                        bool Draw = p->theView.pixelPerM() > 1;
> +                       // Do not draw GPX nodes when enhanced track
> visibility is enabled
> +                       if (M_PREFS->getEnhanceTrackVisibility() &&
> Pt->layer()->isTrack())
> +                               Draw = false;
>                        if (!Draw) {
>                                if (!Pt->sizeParents() &&
> (p->theView.pixelPerM() > LOCALZOOM) )
>                                        Draw = true;
> Index: src/Preferences/MerkaartorPreferences.cpp
> ===================================================================
> --- src/Preferences/MerkaartorPreferences.cpp   (revision 16293)
> +++ src/Preferences/MerkaartorPreferences.cpp   (working copy)
> @@ -1226,6 +1226,7 @@
>  M_PARAM_IMPLEMENT_STRING(DefaultStyle, style, ":/Styles/Classic.mas")
>  M_PARAM_IMPLEMENT_STRING(CustomStyle, style, "")
>  M_PARAM_IMPLEMENT_BOOL(DisableStyleForTracks, style, true)
> +M_PARAM_IMPLEMENT_BOOL(EnhanceTrackVisibility, style, true)
>
>  /* Visual */
>  M_PARAM_IMPLEMENT_BOOL(BackgroundOverwriteStyle, visual, false)
> Index: src/Preferences/MerkaartorPreferences.h
> ===================================================================
> --- src/Preferences/MerkaartorPreferences.h     (revision 16293)
> +++ src/Preferences/MerkaartorPreferences.h     (working copy)
> @@ -288,6 +288,7 @@
>        M_PARAM_DECLARE_STRING(DefaultStyle)
>        M_PARAM_DECLARE_STRING(CustomStyle)
>        M_PARAM_DECLARE_BOOL(DisableStyleForTracks)
> +       M_PARAM_DECLARE_BOOL(EnhanceTrackVisibility)
>
>        /* Visual */
>        M_PARAM_DECLARE_BOOL(BackgroundOverwriteStyle)
> Index: src/Preferences/PreferencesDialog.cpp
> ===================================================================
> --- src/Preferences/PreferencesDialog.cpp       (revision 16296)
> +++ src/Preferences/PreferencesDialog.cpp       (working copy)
> @@ -153,6 +153,7 @@
>     updateStyles();
>
>
>  cbDisableStyleForTracks->setChecked(M_PREFS->getDisableStyleForTracks());
> +
> cbEnhanceTrackVisibility->setChecked(M_PREFS->getEnhanceTrackVisibility());
>
>        QString t = M_PREFS->getDefaultTemplate();
>        QString ct = M_PREFS->getCustomTemplate();
> @@ -272,6 +273,10 @@
>
>  M_PREFS->setDisableStyleForTracks(cbDisableStyleForTracks->isChecked());
>                PainterToInvalidate = true;
>        }
> +       if (cbEnhanceTrackVisibility->isChecked() !=
> M_PREFS->getEnhanceTrackVisibility()) {
> +
> M_PREFS->setEnhanceTrackVisibility(cbEnhanceTrackVisibility->isChecked());
> +               PainterToInvalidate = true;
> +       }
>        if (PainterToInvalidate) {
>                for (FeatureIterator
> it(((MainWindow*)parent())->document()); !it.isEnd(); ++it)
>                {
> Index: src/Preferences/PreferencesDialog.ui
> ===================================================================
> --- src/Preferences/PreferencesDialog.ui        (revision 16293)
> +++ src/Preferences/PreferencesDialog.ui        (working copy)
> @@ -563,6 +563,13 @@
>             </property>
>            </widget>
>           </item>
> +          <item>
> +           <widget class="QCheckBox" name="cbEnhanceTrackVisibility">
> +            <property name="text">
> +             <string>Enhance GPX track visibility</string>
> +            </property>
> +           </widget>
> +          </item>
>          </layout>
>         </widget>
>        </item>
>
> _______________________________________________
> Merkaartor mailing list
> Merkaartor at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/merkaartor
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/merkaartor/attachments/20090706/07bf5f1d/attachment.html>


More information about the Merkaartor mailing list