Commit graph

192 commits

Author SHA1 Message Date
Marcus Jaschen
4b5d08e5ed
fix for #494 (#550)
If a way segment contains more than one `surface` tags (e.g.
`surface=*` and `cycleway:surface=*`), the tag best suited for the
current routing type (currently only *cycling* is supported) is
selected.

i.e. if a `cycleway:surface=` tag belongs to the current way segment
it will be used for the analysis exclusively (all other `surface`
tags are skipped from now on).
2022-06-01 11:08:06 +02:00
Norbert Renner
0fc60c1821 Work around iOS 3rd party browser download (#418)
- use FileReader.readAsDataURL (for iOS Chromium)
- add alternative Download from Server for now until proven in Prod and fixed in iOS Firefox (no i18n)
- replace cloud icons as client-side now
2022-05-28 14:27:32 +02:00
Norbert Renner
1d26949770 Refactor download 2022-05-27 12:16:05 +02:00
Norbert Renner
e5ea9173ae
Merge pull request #497 from nrenner/68-sl-routing
Add straight line support to routing
2022-05-12 16:26:00 +02:00
Norbert Renner
6a19b53dc0 Add interpolated warning for stats with beeline 2022-04-11 19:24:48 +02:00
Norbert Renner
7bbbffbd3f Get selected profile vars despite pinned custom 2022-02-16 16:12:24 +01:00
Norbert Renner
4d44153316 Read time/energy calc variables from profile
and ensure profile text is loaded before updating route and straight line stats
2022-02-15 19:30:49 +01:00
Marcus Jaschen
d9699127f9 Highlight route segments for parts with normalized surface and smoothness values
This commit ensures that all matching route segments are highlighted when hovering over a surface or smoothness line in the analysis tables.
2021-11-20 14:17:20 +01:00
Marcus Jaschen
9ca93e4c03 Normalize surface and smoothness variants
The `surface` tag exists in different variants,
e.g. `surface`, `cycleway:surface` etc.

Previously, the `surface` and `smoothness` tags were only processed for route analysis if they were found in their canonical form in the BRouter server response.

With this commit, the variants are normalized down to the main tag name which has the effect that they're included in the route analysis.

Fixes #438
2021-11-20 13:46:14 +01:00
Marcus Jaschen
492797f2a5
Add OpenStreetMap Notes Layer (#458)
* use a local variable (best practices)

* Add OpenStreetMap notes as overlay.

This commit adds a new layer which renders OpenStreetMap notes in the
current view.

The layer can be activated via the "More" button in the layers sidebar.

Fixes #439
2021-11-17 20:03:07 +01:00
Marcus Jaschen
f1557a1d5c remember and recall last used (non-custom) profile 2021-11-15 19:00:40 +01:00
Norbert Renner
f185d78dca Support undefined highway tag for beelines 2021-06-29 21:51:28 +02:00
Norbert Renner
3c8be96085 Support beelines in hash url (first stab) 2021-06-19 16:23:01 +02:00
Norbert Renner
c3db03d1e3 Keep ele when removing duplicates on concat 2021-06-11 12:01:10 +02:00
Norbert Renner
1330317f1d Merge branch 'master' into 68-sl-formatting 2021-04-10 12:48:10 +02:00
Norbert Renner
393a3fa129 Cleanup and credits 2021-04-09 11:52:51 +02:00
Norbert Renner
c3abfa9c9a Show overpass icons in layer tree 2021-04-07 18:05:47 +02:00
Norbert Renner
7aa2fcb93c Download in client from Blob URL 2021-04-01 23:42:56 +02:00
Henrik Fehlauer
7edae911dc Select parts of trackname in export dialog for easier overwriting
Users might want to assign custom tracknames, which requires deleting the
default name either entirely or parts of it.

By pre-selecting parts of the trackname, users can start typing right away
after opening the dialog. `Ctrl+A` to select everything is still possible,
but keeping the distance in the filename by default comes in handy,
e.g. when using a file manager not displaying the track length.

NB: Might need adaptation once trackname validation becomes less strict,
i.e. currently "(" and "->" as specified in the message catalog are replaced
with ' - ' by the validator before being inserted into the dialog.

Test Plan:
- Open "Export" dialog ("Location - Other Location - 2km")
- Open "Export" dialog for roundtrip ("Location - 1km")
- In both cases the complete trackname except for the distance
  information (including separator) should be selected.
- No unwanted behaviour even if Nominatim is slow or down.
2021-04-01 18:00:00 +00:00
Norbert Renner
0fc468a682 Format CSV 2021-04-01 12:17:18 +02:00
Norbert Renner
00f2cead36 Format KML 2021-04-01 11:53:17 +02:00
Norbert Renner
9f5cb05532 Show specific message type for loading 2021-03-24 09:32:49 +01:00
Gautier P
83ac111262 Remove whatsnew icon when modal is displayed or dismissed 2021-03-23 16:29:04 +01:00
Gautier P
cb9f4fd85d Fix error/warning messages display 2021-03-23 11:06:35 +01:00
Norbert Renner
265583e0c5 Format name and creator 2021-03-19 12:22:20 +01:00
Stefan Siegl
06f0be719d
allow to add custom overpass queries 2021-03-19 11:45:23 +01:00
Norbert Renner
da9ffd9224 Format POIs 2021-03-19 10:23:37 +01:00
Norbert Renner
7fc2f6bee5 Format route points as waypoints 2021-03-18 18:04:57 +01:00
Norbert Renner
2189d68af9 Parse voicehint modes form profile 2021-03-16 19:56:02 +01:00
Norbert Renner
25f8828ae7 Concatenate total track
+ handle server voicehint time removed, times with 3 digits
2021-03-12 21:20:35 +01:00
Gautier P
a0a78cdab2
Translate overlay type and fix width computation (#379) 2021-03-01 20:19:38 +01:00
Gautier P
e188d8f9de
Use plural form when multiple overlays are active (#378) 2021-03-01 20:13:42 +01:00
Gautier P
1a695db333
Add What's new modal (#372) 2021-02-23 18:27:08 +01:00
Gautier P
25429b3c24 Update prettier version 2020-12-05 11:51:16 +01:00
Gautier P
a2366a26bd Split ring in two to avoid routing issue 2020-12-03 21:04:55 +01:00
Gautier P
779c720b7d
Add 20km allowed zone icon (#347)
Co-authored-by: Gautier P <gautier_git@damsy.net>
2020-12-01 20:56:14 +01:00
Norbert Renner
a1af69a44c Prevent submit action to avoid side effects (#328)
Otherwise the download is blocked and a `/?format=gpx#` query is added to the URL in Chromium.
2020-08-04 11:13:24 +02:00
Norbert Renner
2df1f617c9 Improve hiding elevation chart when empty
Consider additional cases:
- flag got reset when deleting and adding first waypoint
- don't show empty on load, postpone to update
- don't store state when hidden because empty
2020-07-16 10:28:40 +02:00
Norbert Renner
4892c2a1db Don't update TrackAnalysis when tab is hidden
- add missing show/hide methods called by sidebar and maintain active state
- rename inconsistent tab id
2020-06-30 21:35:51 +02:00
Henrik Fehlauer
09f987ea07 Combine and reuse translations for keyboard shortcuts
Using i18next's "nesting" and "interpolation" features should reduce the
overall number of strings to translate, as well as provide a
standardized pattern for shortcut tooltips (if applicable).

Note that this approach is still allowing for flexibility regarding
differently structured sentences in each language.

Resolves #315
2020-06-21 18:00:00 +00:00
Henrik Fehlauer
a420ad5c0b Add shortcut to export route
Press 'X' to trigger the export route dialog.

Automatically populating the trackname field should work too.
2020-06-10 18:00:00 +00:00
Henrik Fehlauer
6da520ed4d Add shortcut to toggle profile switcher
Press 'G' to open the profile switcher, select a profile with the arrow
keys, apply with 'Enter' and close the switcher with 'Escape'.

While 'T' and 'P' will be / were already taken, 'G' is at least easily
reachable with the left hand for users using a mouse with their right
hand at the same time.

Since Bootstrap keeps updating the tooltip when changing options in the
dropdown (which is useful in case the text is longer than the width of
the control), the shortcut text needs to be applied dynamically too.
2020-06-09 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
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
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
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
Gautier P
bbaad4f8b3 Hide stats footer by default and collapse elevation chart if needed 2020-05-25 20:22:49 +02:00