wheelmap-classic
wheelmap-classic copied to clipboard
Widget: Cookies override location settings in widget
Hey there,
I just found out that the widget shows the last location from my visit on wheelmap.org instead of the widget default location. Could we try to fix this? Short example:
- I visit http://travelable.info/infoseiten/sylt/ and have a look at the widget below
- I expect the widget to show the geographic region of Sylt as defined within the widget settings
- Instead I see a high-level zoom on Eldenaer Str. in Berlin where I have been before on wheelmap.org/map.
A fix would be really helpful for people that are actually using the wheelmap and visiting other websites with the embedded widget.
I am unable to reproduce this issue in Firefox.
Steps taken:
- Visit http://travelable.info/infoseiten/sylt/
- Click some things on the map.
- Visit https://wheelmap.org/map
- Drag the map around a bit until I get a URL like https://wheelmap.org/map#/popup/1288091305?lat=52.50812429253185&lon=13.186683654785156&zoom=14
- Click on a couple nodes (Like https://wheelmap.org/map#/popup/268917494?lat=52.52828459906009&lon=13.186683654785156&zoom=14 and https://wheelmap.org/map#/popup/1885599514?lat=52.52828459906009&lon=13.186683654785156&zoom=14)
- I navigate to http://travelable.info/infoseiten/sylt/ again and see the correct area

Please confirm this is still an issue!
@thermann78 cc @Svenyo
Can you please specify a) if this ticket is still valid? b) what browser you were using?
@1000miles yes, prob still exists. Tried with Safari 10.0.1 on OS X.
I am also not able to reproduce this. I tried the steps @Hoverbear described in both Chrome 56 and Safari 10.0.2 on macOS Sierra.
@thermann78 can you elaborate on this? Eg. are you logged in and is it possible that your account is the same as the one used for the travelable widget (API token)?
Nope, problem persists. I'm not logged in. Tried again:
- Did a search on Wheelmap.org für "Tübingen".
- Opened http://travelable.info/infoseiten/sylt/
- Saw the surroundings of Tübingen in the widget.
No login, even API key is not from my personal account but from an account I registered exclusively for the purpose of creating widget code.
@thermann78 thanks. Hmm I still can't reproduce this. Can you try again and delete your wheelmap cookies beforehand (or try in inkognito mode)?
It works correctly in incognito mode. So it is backing my theses that the widget is using cookies from the map which include the last coordinates. If so, this wouldn't make too much sense as the widget is primarily considered to show the location defined within the embed code instead of the last location searched for on Wheelmap.
Still unable to reproduce this after following @thermann78's steps:
I noted the following:
We explicitly avoid setting anything in the cookie when the map is moved and we are using a widget. (https://github.com/sozialhelden/wheelmap/blob/master/app/assets/javascripts/controllers/map.controller.js.coffee#L211)
Looking at the controller for the map (https://github.com/sozialhelden/wheelmap/blob/master/app/assets/javascripts/controllers/map.controller.js.coffee#L130-L142) we can see that the code does not read from the cookie, it just reads from the query string ?bbox=...
attribute in the URL:
<iframe src="//wheelmap.org/embed/asMbikXCBLzj4NKV6dUB#/?bbox=55.0583511,54.7418629,8.2788526,8.489955" height="400" width="500"></iframe>