Commit graph

1298 commits

Author SHA1 Message Date
Marcus Jaschen
6b24a8790e add 'break' to switch to prevent fall-through 2024-07-02 18:23:19 +02:00
renovate[bot]
67547f3494 Update dependency @maplibre/maplibre-gl-leaflet to v0.0.20 2024-06-01 16:32:14 +02:00
alexcojocaru
12dc322a54 Disable gradient normalization in profile; add legend 2024-06-01 16:30:36 +02:00
alexcojocaru
135340781d Update the geo-data-exchange dependency with support for gradient normalization 2024-06-01 16:30:36 +02:00
alexcojocaru
bd1fe58dbf Use the newer geo-data-exchange library 2024-06-01 16:30:36 +02:00
renovate[bot]
618f85cba2 Update dependency @mapbox/togeojson to v0.16.2 2024-06-01 16:28:44 +02:00
Manuel Fuhr
96e3355c85 Store custom layers as FeatureCollection
Replace custom format with GeoJSON Features which are already used for
layer configuration. This allows storing also MVT or GeoJSON layers.
2024-06-01 16:28:28 +02:00
renovate[bot]
97b94fb5c4 Update dependency postcss to v8.4.31 [SECURITY] 2024-06-01 16:25:43 +02:00
dependabot[bot]
674f5ce120 Bump word-wrap from 1.2.3 to 1.2.4
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-01 16:25:15 +02:00
Marcus Jaschen
c93662ef76 replace style attribute with proper class 2024-06-01 16:15:34 +02:00
Marcus Jaschen
c7e1c4e6a7 add error handling for invalid URLs 2024-06-01 16:15:34 +02:00
Marcus Jaschen
2a7dc36678 store/retrieve last used Mastodon instance to/from local storage 2024-06-01 16:15:34 +02:00
Marcus Jaschen
0d15726250 update share dialog
- change order of items between mobile and desktop views:
  - QRCode is rendered at first when displayed on a desktop (viewport >= 992px)
  - links and buttons are rendered first on mobile devices (viewport < 992px)
- add some spacing between buttons
2024-06-01 16:15:34 +02:00
Marcus Jaschen
9e47cf24e4 Enable sharing via Mastodon
Sharing works now with newer Mastoton releases.
2024-06-01 16:15:34 +02:00
sylvainavelo
c23d28f554 Change IGNF layers URLs 2024-05-27 09:58:53 +02:00
Norbert Renner
77672d5cde Remove tile.openstreetmap.de subdomains
+ max zoom 19, see https://community.openstreetmap.org/t/a-b-c-tile-openstreetmap-de-subdomains-von-tile-openstreetmap-de-werden-aufgehoben/100830
2023-07-31 20:50:41 +02:00
Norbert Renner
5905bfc656
Merge pull request #753 from rkflx/PR/adapt-voicehints-to-brouter-changes
Adapt voice hints and exporting to changes in BRouter 1.7.X
2023-07-22 20:08:23 +02:00
Henrik Fehlauer
8809fa94cf
Prevent Gpsies-style export from throwing for undefined symbols
While abrensch/brouter@82fecf9 fixed the export already by avoiding the
problematic `OFFR` voice hint, we would still throw in case we
encountered an `undefined` symbol entry:

> Uncaught TypeError: Cannot read properties of undefined (reading
> 'toLowerCase')

This can be prevented by not calling `toLowerCase()` on `undefined`
objects.

Fixes #751

Test Plan:
  - Change `VoiceHints.commands` to contain `undefined` entries for a
  particular voice hint.
  - Create a route with that voice hint.
  - Test that exporting for each `turnInstructionMode` does not throw.
2023-07-08 09:50:13 +00:00
Henrik Fehlauer
96016b7fd0
Document new export formats added in BRouter 1.7.0 and fix export error
BRouter 1.7.0 implemented support for three new export formats:
"Cruiser", "BRouter internal" and "Locus(-new)".

"Cruiser" (`turnInstructionMode=8`) and "BRouter internal"
(`turnInstructionMode=9`) are not yet exposed in BRouter-Web's UI
through profiles, so we do not need to implement them at the moment.
Here we only document them by making them explicit unimplemented `cases`
in the code.

In addition, BRouter changed "locus-style" with `turnInstructionMode=2`
to emit a different format for newer releases of Locus, while the old
format is now referred to as "locus-old-style" from profiles with
`turnInstructionMode=7`. Since BRouter-Web does not know yet about the
the new id, exports will fail with "unhandled turnInstructionMode"
errors.

To fix the latter issue, we now map `turnInstructionMode=7` to the newly
renamed `LocusOldVoiceHints()`. Note that `turnInstructionMode=2` is
also currently using `LocusOldVoiceHints()`, i.e. the new format still
needs an implementation.

Test Plan:
  - `yarn test`
  - Check choosing "locus-old-style" now exports without an error.
2023-07-07 16:44:21 +00:00
Henrik Fehlauer
eeb1c5bde3
Emit console warning when using an unsupported BRouter version
abrensch/brouter@c9ae7c8681 changed indexing of voice hint ids, because
some new hints were inserted in the middle instead of strictly at the
end, changing the numbering of existing ids. For example, now id `12`
was sent to indicate a right u-turn, while we still assume the old
meaning of `12`, i.e. "off route". This clearly was an API break.

This leads us to abort exporting with the Gpsies turn instructions
style, since `OFFR` has an `undefined` symbol assigned, as well as
emitting wrong voice hints for ids after `9`. Another unwelcome side
effect is showing negative exit numbers for roundabouts.

This breakage in the GeoJSON HTTP API has been shipping in BRouter 1.7.0
and 1.7.1 and finally got fixed with abrensch/brouter@82fecf9 contained
in BRouter 1.7.2 or later. Earlier releases like 1.6.3 are also
unaffected. To avoid emitting incorrect voice hints in BRouter-Web,
running with broken versions of BRouter should be avoided.

By checking the "Creator" field after receiving the first response from
BRouter, we can now emit a warning if the version of BRouter used is
unsupported. The warning mostly targets administrators and power users,
i.e. those responsible for choosing the software versions used, and it
is also only shown once per session.

Note that the version check is compatible with the common "SemVer"
scheme, so the check should continue working and even support more
complex version compatibility scenarios as long as BRouter stays
SemVer-compliant.

Ref #751

Test Plan:
  - Run with BRouter 1.6.3 and 1.7.2, no warnings shown.
  - Run with BRouter 1.7.0 and 1.7.1, warnings shown only for the first
  segment.
2023-07-06 09:46:47 +00:00
Henrik Fehlauer
3f241c9180
Add BL and TLU to VoiceHints as contained in BRouter 1.7.2
abrensch/brouter@c9ae7c8681 added support for two new voice hints: A
hint for beelines (`BL`), and a hint for 180 degree u-turns (`TU`). By
adding support for both, we now know about all types of voice hints as
defined in BRouter again.

What makes things confusing is that the `TU` name for the respective
`static final int` constant in BRouter's `VoiceHint.java` was repurposed
for 180 degree u-turns, with left u-turns now being mapped to the new
`TLU` constant name. Also note that originally the indexing of voice
hints as used in BRouter's GeoJSON API has been changed as well due to
inserting new commands in the middle of the numbering scheme instead of
at the end. This API break has been fixed only in
abrensch/brouter@82fecf9. Here we will rely on the fixed indexing,
BRouter versions 1.7.0 and 1.7.1 without the re-indexing revert will not
be supported.

In addition, the voice hint mapping table has been checked to be
identical to BRouter (this led to adding a missing `OFFR` symbol), and
clarifying comments for planned future changes (e.g. changing the `TU`
output token to `TLU` for OsmAnd) have been added.

Note that beelines and 180 degree u-turns are only added to the mapping
table for completeness. As BRouter-Web is handling straight lines on the
client-side exclusively (which makes sense performance-wise when loading
a route from a pasted URL with lots of them tracing an unmapped path),
they are not expected to be in any GeoJSON response from BRouter, at
least as of now. The same is true for 180 degree u-turn voice hints at
cul-de-sac-style vias. If and when to emit voice hints for both cases in
BRouter-Web itself is a different question, though it could likely also
use the table for lookup.

Test Plan:
  - `yarn test`
  - Confirm voice hints for routes with roundabouts and u-turns are
  unchanged.
2023-07-05 06:26:07 +00:00
Norbert Renner
b64b3c6910 Recreate yarn.log after error
Deleted yarn.lock file and recreated with `yarn install` because of getting error:

[BABEL]: Cannot use 'in' operator to search for 'CallExpression' in undefined (While processing: brouter-web/node_modules/@babel/preset-env/lib/index.js)
2023-06-22 10:43:03 +02:00
renovate[bot]
47672b890c
Update dependency @fortawesome/fontawesome-free to v6.4.0 (#741) 2023-06-22 10:06:14 +02:00
renovate[bot]
f91898b2a9
Update dependency leaflet-geometryutil to v0.10.2 (#740) 2023-06-22 10:05:00 +02:00
renovate[bot]
4aa9d20f31
Update dependency i18next-browser-languagedetector to v7.0.2 (#739) 2023-06-22 10:03:26 +02:00
renovate[bot]
b02af01acd
Update dependency codemirror to v5.65.13 (#737) 2023-06-22 10:02:43 +02:00
renovate[bot]
60500c01b8
Update dependency eslint to v8.43.0 (#721) 2023-06-22 10:02:18 +02:00
renovate[bot]
da7fda9ba5
Update dependency browser-sync to v2.29.3 (#720) 2023-06-22 10:01:18 +02:00
renovate[bot]
8ab909d326
Update babel monorepo to v7.22.5 (#719) 2023-06-22 10:00:12 +02:00
renovate[bot]
94541f61b0
Update dependency postcss to v8.4.24 (#718) 2023-06-22 09:59:25 +02:00
Norbert Renner
1e4de48174
Merge pull request #738 from mjaschen/task/remove-vscode-debugger-extension
remove 'msjsdiag.debugger-for-chrome'
2023-06-22 09:58:22 +02:00
Marcus Jaschen
2a2dfe1ded remove 'msjsdiag.debugger-for-chrome'
This extension was deprecated as the functionality is
now included in VSCode.

see https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome
2023-06-18 10:28:50 +02:00
Norbert Renner
587b4b83a5 Fix duplicate i18n keys and update locale (#735) 2023-06-16 16:54:45 +02:00
Norbert Renner
dd7cd574b1
Merge pull request #736 from mjaschen/feature/690-overpass-layer-bike-charging-stations
add overpass layer for bicycle charging (fixes #690)
2023-06-16 12:24:07 +02:00
Norbert Renner
b8c2c945de
Merge pull request #735 from mjaschen/feature/help-dialog
Add "Help" dialog which shows available keyboard shortcuts
2023-06-16 12:20:33 +02:00
Marcus Jaschen
8f31322464 add overpass layer for bicycle charging (fixes #690) 2023-06-11 09:45:03 +02:00
Marcus Jaschen
4c276428a6 Add "Help" dialog which shows available keyboard shortcuts
Dialog can be toggled via button in "About" or via keyboard shortcut "?"
2023-06-11 09:21:13 +02:00
Norbert Renner
bdb7d1f650
Merge pull request #733 from mjaschen/fix/overlay-dialog-long-lines
Wrap long URLs in custom layers overlay
2023-06-05 21:57:47 +02:00
Marcus Jaschen
b78e0e82ce Wrap long URLs in custom layers overlay 2023-06-02 08:06:55 +02:00
Norbert Renner
4d3d919ed0 Fix Mapillary attribution 2023-05-27 13:10:35 +02:00
Norbert Renner
af3d208224 Update caniuse-lite 2023-05-24 20:08:15 +02:00
Norbert Renner
d09fdbcff8 Migrate Transifex config by new CLI client
https://github.com/transifex/cli#migrating-from-older-versions-of-the-client
2023-05-19 21:55:29 +02:00
Norbert Renner
bac32de98b Update i18n keys (#729) 2023-05-19 16:18:27 +02:00
Norbert Renner
7acdd864f2
Merge pull request #730 from mjaschen/fix/remove-text-artifacts-qrcode-error
Hide legend for QR Code size toggle when QR Code cannot be rendered
2023-05-19 15:15:47 +02:00
Marcus Jaschen
806675fc22 simplify hiding QR Code size buttons 2023-05-18 14:48:10 +02:00
Marcus Jaschen
0cc9b8b13f hide legend for QR Code size toggle when QR Code cannot be rendered 2023-05-18 14:41:12 +02:00
Norbert Renner
2493fd6465 Fix hash formatting for POI at 0,0
Opening this URL and moving the map produces `pois=NaN,NaN` in the URL hash:
https://brouter.de/brouter-web/#map=2/0/0/standard&pois=0,0,Null%20Island
2023-05-17 13:02:47 +02:00
Norbert Renner
43b1b70a0a Don't filter points of GeoJSON layer (#727) 2023-05-17 12:27:23 +02:00
Norbert Renner
b772924106 Move export dialog check outside onUpdate (#729)
to only check once on init, not on every update. Waypoints available at time of callback. Add check for lonlats param as event isn't called without and error check.
2023-05-16 11:55:26 +02:00
Marcus Jaschen
3b3357c473
Share Dialog with QR Code (#729) 2023-05-16 11:31:32 +02:00