brouter-web icon indicating copy to clipboard operation
brouter-web copied to clipboard

Update leaflet to 1.9.4

Open gorgobacka opened this issue 1 year ago • 6 comments

This is a starting point to update Leaflet to the most recent version (solves #792).

I managed to fix the most obvious issue with the no-go-area. They are usable.

However, there is still one exception on the browser console that I couldn't solve so far. leaflet-nogo-areas

Maybe someone else is able to fix it.

gorgobacka avatar Sep 23 '24 20:09 gorgobacka

I think I've figured it out and made a pull request in your repository.

It'd be nice if you can verify that it works now and update this PR.

https://github.com/gorgobacka/brouter-web/pull/1

mjaschen avatar Oct 12 '24 09:10 mjaschen

@mjaschen found the missing piece. :+1:

This PR is ready now.

gorgobacka avatar Oct 13 '24 21:10 gorgobacka

Unfortunately there's a problem which breaks the “No Go Area” feature on touch devices.

tap and hold to create a circle doesn't work.

I've spent some time on the weekend on the search for a fix and didn't found one. But at least I've a workaround which allows placing fixed size no go areas with a single tap on touch devices, so it's usable at least.

Also, the routing library issues a call to DomEvent.fakeStop() when tapping the route, but that method no longer exists. That's another thing which has to be fixed before merging this PR. My workaround for now is to simply remove that method call: https://github.com/mjaschen/leaflet-routing/commit/0690d5e29a8156121f4f6d102bf380459ef01b5a

With these two workarounds, BRouter-Web works fine with Leaflet 1.9.4 – as far as I've tested it.

If I don't find any further bugs, I'll deploy it in the next days to bikerouter.de and create pull requests here. Maybe someone has an idea how to create proper bugfixes instead of workarounds.

mjaschen avatar Oct 14 '24 08:10 mjaschen

I don't have much time to test but I am more than happy to merge this PR when it's good enough to go live :) It'd be nice to fix the detected issues, but if it's really hard I think we can assess if that's really important (the nogo circle workaround seems good enough to me for instance).

If there are other testers available to give it a try and report issues, it would greatly help! Let us know @mjaschen when your instance is live with this branch so that it's easier to test it :)

And many thanks for the PR and follow-up!

bagage avatar Oct 14 '24 18:10 bagage

A version with Leaflet 1.9.4 was deployed to https://bikerouter.de

It contains this pull request with the following additional changes:

  • “No Go Areas“ are placed with a single tap on touch devices; behavior on devices with mouse pointer is unchanged (click + drag). The tooltip adjusts accordingly. The initial size of the circle depends on the viewport width.
    • Todo: figure out how to use tap + drag on iOS touch devices
  • Leaflet-Routing library (diff):
    • replace fakeStop() call on DomEvent as this method no longer exists
    • force showing the trailing line in draw mode after the most recent waypoint was deleted
    • Todo: check if there's an easier/cleaner way to achieve this

mjaschen avatar Oct 15 '24 09:10 mjaschen

@mjaschen Have you received any feedback on bikerouter regarding this implementation during the last months? And is it worth to use it as it is?

gorgobacka avatar Apr 25 '25 05:04 gorgobacka