cyclestreets / mobileweb2011

Mobile HTML client - LEGACY site
https://oldm.cyclestreets.net/
13 stars 2 forks source link

Navigating between sections doesn't remember map position #24

Open mvl22 opened 13 years ago

mvl22 commented 13 years ago
  1. Go to home page
  2. Go to journey planner via map page. Move map to a known location.
  3. Click back to go back to home page.
  4. Go to journey planner page again. Map position will revert.
annapowellsmith commented 13 years ago

It's a side-effect of the architecture - /journey is a separate page from / - so it's reloading the page from scratch.

Not sure how we can get round this. Ideas:

  1. Set a map listener for when tiles move and store the last known location. On page reload, check for last known location, and if it's recent, use that rather than geolocation for initial location.
  2. Move /journey into the main index page - previously it seemed like you had to load Google Maps JS on page load, which I didn't want to do on the home page, but it's possible that in beta you can now load it on journey pagecreate event.
mvl22 commented 13 years ago

Are you sure this isn't just a cookie setting in Google Maps?

annapowellsmith commented 13 years ago

Pretty sure, alas. We would implement it in cookies, but it would be by hand, with an event listener.

mvl22 commented 13 years ago

Feedback:

"If I switch apps of safari windows, and then come back to cyclestreets mobile, it resets the map to the 'default' location each time, rather than leaving it as I had it. I was trying to use the map to copy some street names into another document, and finding it frustrating."

Is this any use: ? http://www.daftlogic.com/sandbox-google-maps-remember-last-location.htm

annapowellsmith commented 13 years ago

Yes, if users are giving you this feedback, it probably is worth improving.

Thanks for the link - yes, that is the method we'd use. As the 'advantages and disadvantages' list says, it needs cookies and extra javascript, but perhaps it is worth doing.

annapowellsmith commented 12 years ago

Have checked a basic fix in, but it's not ideal, because when you return to the page you will get another 'looking for your location' message. Not easy to get round this without some tricky refactoring.

Will leave this open as a long-term enhancement, as it would be much better to move the /journey and /photomap pages into index, then the problem wouldn't arise in the first place (and the code would probably be neater). It's quite a big change though.

mvl22 commented 12 years ago

It seems to be working fine.

By 'looking for your location' message, I don't get that. I only get 'Using your most recent location' which just feels unnecessary. Not a massive problem though.

davidearl commented 12 years ago

The feedback above was from me. Just to say your fix deals with this adequately, thanks very much.

si-the-pie commented 11 years ago

Testing the site while developing some new feature I'm regularly getting the 'looking for your location' message. This is on a device that doesn't know it's location - and it slows down my testing and feels awkward.

Ideally I'd like the site to remember that it failed to get a location once and not try again until I prod it to do so, or if geolocation becomes available.