Commit graph

496 commits

Author SHA1 Message Date
Henrik Fehlauer
36d8a207ab Convert all shortcuts to act on keydown already
Contrary to mouse clicks, when pressing keys on a keyboard the
standard behavior is to perform the associated action immediately,
not only when releasing the key again. This should also improve the
perceived performance slightly.

Note that the 'D' shortcut had formerly been handled by Leaflet, which
we now have to do on our own.

While at it, move the character codes over to the options variable, as
found in other parts of the codebase already.

Also removing the listener from the container does not seem needed
anymore nowadays.
2020-05-26 18:00:00 +00:00
Henrik Fehlauer
8e65d6a3dd Show analysis table highlight above quality coding layer (#304)
When hovering over rows in the analysis tab, highlighted sections for
the route could only be seen on the regular route, but not when any of
the color-coded route visualisations were selected.

Patch based on a similar fix for data table in d33c795200.
2020-05-25 18:00:00 +00:00
Henrik Fehlauer
8ca92e260d Improve analysis tab CSS
There are some ways the look of the analysis tab can be polished:
- Properly right-align the length header
  (it had extra margins required for the sorting arrows in the data tab)
- Use the same font size for table header and body (like in the data tab)
- Improve padding of the totals row (to align with the rows above)
- Add missing style for headings, so they look more balanced
  (the CSS was already there, but the wrong class was used in the HTML)
- Fine-tune vertical spacing (to help visual grouping)
- Remove unused and redundant CSS
- Do not show yellow hover effect over table header
2020-05-24 18:00:00 +00:00
Henrik Fehlauer
9d648fc1d7 Make hotline contrast more pleasant
Colorful routes can conflict visually with colourful maps, therefore
having an outline to make the route stand out more makes sense.

However, using black results in very high contrast levels, which can
become distracting in itself. By using a dark gray, this should look
much more balanced, while still fulfilling the original purpose.
2020-05-23 18:00:00 +00:00
Henrik Fehlauer
900f925276 Improve incline coding visuals and use different colors for going uphill
Currently it is a bit difficult to guess the slope of the route for
planning purposes, since even for routes in very hilly terrain the
colors hardly change. Only extremely steep hills are indicated,
and there is no visual difference between going uphill or downhill.

By cutting off earlier, more of the route will show meaningful
differences in color. Note that BRouter's gradients are already
averaged compared to the maximum gradients shown on road signs, so 15%
should be a good compromise (anything steeper is difficult to ride on
for longer periods anyway, and rightly deserves to be colored with an
alarming red).

By using different colors for the min and max parameters, uphill and
downhill sections should now be easy to distinguish.

By introducing two more color stops, the gradient becomes much smoother,
with flat sections featuring a distinctive green, where they were drawn
in a muddy dark green before.

Note that this approach had been implemented like this in QLandkarte GT
for several years now, with great success.
2020-05-22 18:00:00 +00:00
Norbert Renner
71317b84e4 Fix analysis sorting
Return value of the sort compare function is defined as value less, equal or greater than 0, not as boolean.
2020-06-12 10:57:41 +02:00
Marcus Jaschen
fc54c65e23 Add sidebar tab with route analysis data
- adds a new analysis tab in the sidebar
- the analysis tab shows length distribution for different way types, surface, and smoothness
- table rows can be hovered/clicked to highlight the according segments on the map (similar behaviour as the detailed data table)
- localization is implemented for `de` and `en`
- the method for finding segment edges was extracted from `js/control/TrackMessages.js` into `js/util/TrackEdges.js` as it's used in the new analysis class too (the Gulp config was changed to reflect that)

Notes:

I had the idea to use the *DataTable* plugin for rendering the tables but decided against it. The only meaningful way to sort such a table is by the length column and that's already the case. So it's just three plain, old HTML tables, rendered by jQuery.

For meaningful statistics the `processUnusedTags` setting has to be enabled in the routing profile. Only in this case the BRouter backend includes all needed tags (`highway`, `surface`, and `smoothness`) for *every* route segment in the response. I’ve enabled that setting for all profiles at my BRouter-web instance at <https://brouter.m11n.de/>.
2020-06-07 16:56:50 +02:00
Stefan Siegl
64202a451c
Allow to mute route 2020-06-06 21:47:58 +02:00
Norbert Renner
32d4a26dfd Fix nogo drawing for mobile Chrome, fixes #259 2020-06-05 20:11:36 +02:00
Norbert Renner
f197fb31be Exclude loaded tracks from URL hash 2020-06-03 20:24:17 +02:00
Norbert Renner
9fd9a52a8c Set track color yellow for CyclOSM (#297) 2020-06-02 22:09:22 +02:00
Norbert Renner
e5e876f717 Make privacy policy URL configurable (#284) 2020-05-28 10:54:08 +02:00
Norbert Renner
1b66989cfb
Merge pull request #292 from tbsmark86/master
Fix: Profile params of type 'select' ignored default value from profile
2020-05-27 08:27:35 +02:00
Norbert Renner
b11c182a29 Fix route drag on mobile for Leaflet 1.6.0 (#285) 2020-05-26 12:27:32 +02:00
Gautier P
bbaad4f8b3 Hide stats footer by default and collapse elevation chart if needed 2020-05-25 20:22:49 +02:00
Gautier P
92ad30be17 Hide zoom controls on mobile 2020-05-24 21:24:14 +02:00
Gautier P
a358aed464 Improve stats footer on mobile #296 2020-05-24 19:50:14 +02:00
Gautier P
52be57f5ba Always display 3 digits for distance title, even when ending with zeros 2020-05-24 19:23:00 +02:00
Tobias
3457f92fbf Fix: Profile params of type 'select' ignored default value from profile 2020-05-13 17:14:53 +02:00
Gautier P
23b5439159 Keep fallback values in code in case config.js is not updated with new required fields 2020-04-14 18:44:05 +02:00
Robert Sacks
e91b22ede0 Add config option for initial map position and zoom 2020-04-14 18:42:48 +02:00
Norbert Renner
86d42de458 Show icon indicator when profile is pinned (modified in editor) 2020-02-07 20:02:32 +01:00
Norbert Renner
c94a530f49 Fix overwriting editor changes when switching profile tabs 2020-02-06 20:27:57 +01:00
Norbert Renner
07425148ee Set custom profileName after post
Otherwise next cache get after tab switching still uses original profile
2020-02-05 19:59:55 +01:00
Norbert Renner
164431dccb Fix "Layer not found: route-quality" error msg (ignore built-in layers) 2020-01-08 19:13:15 +01:00
Norbert Renner
83ffa4091d Fix errors when profilesUrl is not defined in config (text undefined) 2020-01-02 13:36:33 +01:00
Norbert Renner
502735cb8e
Replace large awesome-markers with smaller vector-markers (#268) 2019-12-18 21:28:58 +01:00
Norbert Renner
9af707a56e Set loaded markers non-interactive, below route markers (#240) 2019-12-13 14:45:58 +01:00
Norbert Renner
40ad243176 Disable loading wpt type=from/to/via as route because of issues (#254) 2019-12-13 14:30:08 +01:00
Norbert Renner
9d59d51549 Improve distance markers a bit (#243)
- make icons a bit smaller
  - also results in better vertical centering
- round icon too small for 3 digits, multiply width by digits
- increase opacity a bit for better readability
2019-12-13 12:44:24 +01:00
Norbert Renner
d33c795200 Show data table highlight above quality coding layer (#242) 2019-12-12 12:24:43 +01:00
Norbert Renner
61903bb66d Use language-independent URL hash id for quality coding layer (#242) 2019-12-12 12:23:23 +01:00
Norbert Renner
7691e15d61 Add active state to route quality coding button, sync layer (#262) 2019-12-12 11:08:50 +01:00
Norbert Renner
3324f9c270 Move POI button below routing bar (#226) 2019-12-11 17:29:28 +01:00
Norbert Renner
41b349dc9f Remove gap in control bar by hiding empty dummy track loader button 2019-12-11 17:27:55 +01:00
Norbert Renner
a71dfe7895
Add hints and feedback for optional layers tree usage (#263) 2019-12-06 09:31:55 +01:00
Norbert Renner
0781bb85dc Use Polyline.getCenter instead of bounds to center hover on map (#241)
Returns point on line at half distance instead of centroid of bounds,
which can be far off the line for curved lines and not show line at high
zooms.
2019-11-30 12:28:48 +01:00
Norbert Renner
b57c4f2bf6 Make data row selectable, centers on map, disables hover sync (#241) 2019-11-30 12:18:15 +01:00
Norbert Renner
a585dde182 Add switch to turn off centering hovered data table entry on map (#241) 2019-11-30 09:38:12 +01:00
Norbert Renner
a70cf43838 Fix Custom option not disabled when URL with profile
Getting value of 'profile' ele no longer works (?), replace with proper
check if profile name is custom.
2019-11-29 15:45:31 +01:00
Norbert Renner
a006d64a6d Don't show save warning in editor tab on options apply 2019-11-13 11:11:14 +01:00
Norbert Renner
4efa6247aa Improve profile parameters layout: button always visible, smaller font
- Flexbox layout with scrolling inner content instead of whole tab
- same smaller font size like in layers tab, small input fields
2019-11-13 10:44:34 +01:00
Norbert Renner
b0b8a3d0c0 Remove button state "uploading", no longer supported in Bootstrap v4
https://getbootstrap.com/docs/4.3/migration/#buttons
https://getbootstrap.com/docs/3.3/javascript/#buttons-stateful
2019-11-12 10:04:13 +01:00
Norbert Renner
21a8d8b5de Replace profile options/editor switch buttons with Bootstrap tabs 2019-11-11 19:30:29 +01:00
Norbert Renner
ef9cc7abe7
Merge pull request #235 from Phyks/custom-profiles
First PoC for UI for customizing profile
2019-11-09 09:47:32 +01:00
Norbert Renner
0809b17577 Fix broken route segment coloring (#250)
- with var instead of const all callbacks referenced last value in loop,
add closure
- cloning by property overwrites default when undefined, use L.extend
for Object.assign
2019-11-07 18:34:01 +01:00
Gautier Pelloux-Prayer
f4285f38a1 Remove flat() usage 2019-11-03 14:36:26 +01:00
Gautier Pelloux-Prayer
71c5075f9c Add eslint 2019-11-03 14:29:26 +01:00
Gautier Pelloux-Prayer
a23634e1c4 Use custom markers for start and end 2019-10-19 10:15:36 +02:00
Norbert Renner
cb8aeee6ea
Merge pull request #241 from matzepan/feature/center-track
Feature/Center the map to the track when hovering on it
2019-10-11 12:39:35 +02:00