Commit graph

121 commits

Author SHA1 Message Date
Henrik Fehlauer
48f8fe3524 Add shortcut to delete last point
Press 'Z' to undo adding the last point.
2020-06-05 18:00:00 +00:00
Henrik Fehlauer
a852acbfce Add shortcut to create no-go areas
Press 'N' to initiate drawing a no-go area. 'Escape' will cancel,
similar to how drawing a route works.
2020-06-04 18:00:00 +00:00
Henrik Fehlauer
2848e4dd36 Add shortcut to reverse route
Press 'R' to swap start and end of the route.
2020-06-03 18:00:00 +00:00
Henrik Fehlauer
37ab05310b Add shortcut for geocoder search field
Press 'F', type a query and press 'Enter' to find places effortlessly.

Note that the button already triggers on mousedown events, even though
by convention it should react on mouseup (i.e. a regular click)
only. However, that's an issue in the external dependency, and can
be worked around for now.
2020-06-02 18:00:00 +00:00
Henrik Fehlauer
f23e3751b5 Allow translation of the search field placeholder text
It was not translated before, since the string was coming from an
external dependency.
2020-06-01 18:00:00 +00:00
Henrik Fehlauer
8e78c858c1 Add shortcut to toggle color coding button
Press 'C' repeatedly to switch between the various color coding options.
When the last one is reached, we show the regular route again.
2020-05-30 18:00:00 +00:00
Henrik Fehlauer
d6c648d3eb Fix mute shortcut not working for color coded routes
The mute shortcut would only work for regular routes before.

Note that no-go areas, POIs and tracks continue to be unaffected
by muting, so e.g. peeking at a track below the route is still possible.
2020-05-29 18:00:00 +00:00
Henrik Fehlauer
08c8cfa8be Prevent more accidental shortcut triggers
Do not allow browser keyboard shortcuts to trigger route functions,
e.g. pressing Ctrl+P triggers printing in most browsers, but should not
at the same time switch BRouter-Web to POI mode. This can be prevented
by filtering for modifiers.

In the same fashion, when modal dialogs or dropdowns are open it should
not be possible to activate map functions in the background now.

Finally, inhibit shortcuts in number input fields too, as found in the
editable number input fields in the customize profile options.
Previously only regular text input fields were protected.

To make those checks easier to use, they are deduplicated and moved to
Util.js.
2020-05-28 18:00:00 +00:00
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
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
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
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
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
41b349dc9f Remove gap in control bar by hiding empty dummy track loader button 2019-12-11 17:27:55 +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
ddf8e27085
Merge pull request #226 from bagage/222-add-users-poi
export user's POI (point of interest)
2019-10-10 22:17:44 +02:00
Gautier Pelloux-Prayer
fa5af58372 Add markers POI layer 2019-10-10 21:07:49 +02:00
Norbert Renner
a038f0448d
Merge branch 'master' into feature/distance-marker 2019-10-10 20:04:14 +02:00
matzepan
bc480af774
Merge branch 'master' into feature/distance-marker 2019-10-10 19:48:03 +02:00
Matzepan
544aab0716 Fixed problems with gulp-uglify 2019-10-10 19:36:25 +02:00
Unknown
023e30073d Incline is now the first option, cost the last 2019-10-10 19:36:21 +02:00
Unknown
9eeca7e2d5 Added hotline based route overlay
Added a overlay which reflects the quality of the route based on either:
* cost
* altitude
* incline
2019-10-10 19:35:51 +02:00
matzepan
4fdd375b5c removed let 2019-10-02 23:36:35 +02:00
Unknown
fde748f7cf Let seems not to be supported 2019-10-02 23:27:45 +02:00
Unknown
ff1499c62b If a track contains waypoints, they are set to the router 2019-10-02 16:16:29 +02:00
Unknown
1828a642c3 Remove markers when route is deleted 2019-10-02 15:28:37 +02:00
Unknown
173752c691 Added distance markers to the routing path 2019-10-02 14:23:27 +02:00
Unknown
ee54d45790 Changed loaded track to noninteractive 2019-10-01 20:41:28 +02:00
Unknown
4854342c92 Prettified 2019-09-17 12:21:29 +02:00
Unknown
936e5732b2 Implementation of Track loading
Use leaflet-filelayer to load kml, gpx, geojson, json tracks and display them as new Overlay layer.
2019-09-17 12:20:24 +02:00
Gautier Pelloux-Prayer
d31be926d2 Increase prettier maxwidth to 120 2019-08-10 19:36:36 +02:00
Gautier Pelloux-Prayer
d00fe15ff1 Refactor error handling 2019-08-07 18:20:24 +02:00
Gautier Pelloux-Prayer
ba12f0d609 Extract nogo areas upload in BR.NogoAreas 2019-08-07 11:08:19 +02:00
Norbert Renner
ef41a9e5ff Restore active layers (#205) 2019-06-18 09:14:08 +02:00
Gautier Pelloux-Prayer
60029df6d9 Upgrade leaflet geocoder to properly parse lat/lng 2019-06-16 19:04:18 +02:00
Henrik Fehlauer
2022069066 Fix unintentional shortcut activations when typing text
Test Plan:
Pressing 'd' key in search box and in custom profile editor no longer
activates route drawing.
2019-05-30 23:52:59 +02:00
Gautier Pelloux-Prayer
970a34981f Add prettier and reformat code 2019-05-17 20:55:39 +02:00
Gautier Pelloux-Prayer
d009aa5bc6 Add reverse route button 2019-05-11 17:52:16 +02:00
Norbert Renner
430ec1cd38 Refactor StravaSegments init into plugin wrapper 2019-04-04 12:03:28 +02:00
Norbert Renner
282edbbc01 Prevent unnecessary tile loading for default base layer
by only setting it if no layer activated by hash URL
2019-04-03 12:41:39 +02:00