buskerudbyen / cycling-norway

3 stars 2 forks source link

Hard to define map jumps: Please investigate #104

Closed tsobuskerudbyen closed 6 months ago

tsobuskerudbyen commented 9 months ago

I have noticed sometimes that when using a sykkelveier.no link to a defined place the map jumps to another location. I do not want that to happen.

Replicable scenario

  1. Open a new browser that has not shown sykkelveier.no before (or use a private browser window). Use the url: https://sykkelveier.no/?#17.49/59.739706/10.204554 for example and paste in and load.
  2. The browser then asks for permission to fetch the GPS location. Whether you approve or reject the map will jump to a location that is not the link. Can we avoid this please?

Hard to replicate scenario

  1. Use a browser that has been used with sykkelveier.no many times before. Paste in the url over.
  2. It jumps to the right location, but then moves for some reason.

I will try to replicate the next time it happens, and update the documentation here.

Beck-berry commented 9 months ago

79 did not consider that lat and lon values can be given in the URL, thus always set a random city to the map center. I fixed this.

tsobuskerudbyen commented 8 months ago

@leonardehrenfried Still an issue on current live solution. This ticket not deployed yet?

leonardehrenfried commented 8 months ago

I don't think there is a fix for this yet. Am I correct, @Beck-berry ?

tsobuskerudbyen commented 8 months ago

If that is the case, and this is hard to get to work in a good manner, I would like to maybe revert #79. I would like prioritize to have the url to a location to work every time. Like 1 in the nummbered list in the description of this ticket.

Beck-berry commented 8 months ago

Sorry, I did not raise a PR for this, but Leonard deployed yesterday, and seems to be working well today. Can you recheck, @tsobuskerudbyen? Then this can be closed.

leonardehrenfried commented 8 months ago

@Beck-berry BTW, I've now given you access so you can actually deploy yourself.

You need to simply run make deploy from the root of this repo to do it.

Can you try it out and let me know if it worked?

tsobuskerudbyen commented 8 months ago

Reproduced twice:

  1. Open the link in description in a new private window in Firefox. Click on "Tillat". Map jumps. (May not be a problem on embedded maps? But still. Can we avoid this, so that it is only in the scenario when a 'fresh' browser is used it jumps?
  2. Copy the same link. Paste and load in a new normal tab in Firefox (or make a new Window). The first load is never on the designated location. You may have to wait 3 seconds.
Beck-berry commented 6 months ago

Can you recheck, @tsobuskerudbyen? I still cannot reproduce this.

tsobuskerudbyen commented 6 months ago

Still reproducible. Just opened the link in the description in Edge and my GPS location was opened, and not a zoom down to Drammen Sykkelhotell. Still, it seems that different browsers behave differently. Closing for now as this is not a big issue any more.