Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#1365 closed defect (wontfix)

Permalink not working until after page load.

Reported by: emj Owned by: Tom Hughes
Priority: trivial Milestone: Wishlist
Component: website Version:
Keywords: javascript, html, slippymap, Cc:

Description

This isn't an important ticket, you are free to mark it as "will-not-fix".

  1. go somewhere on the map
  2. open a new window go to openstreetmap.org
  3. The map should zoom where you were before
  4. click "view" before page is completely loaded

Result: It links to http://openstreetmap.org/ not to the zoomed in area.

Change History (4)

comment:1 Changed 10 years ago by Tom Hughes

I'm not quite sure how you expect me to fix this anyway - if the page hasn't fully loaded then there some of the javascript may not have run and hence the view link may not have been updated yet. Short of disabling the mouse until the page has finished loading and all javascript has been run how do you suggest I fix this?

comment:2 Changed 10 years ago by emj

I reported this as a reminder more than a bug report. Ok some naive and stupid solutions, that I haven't tested.

First idea: in site/index.rhtml when entering the Mapinit function run

updatelinks(<%= lon %>, <%= lat %>, <%= zoom %>, <%= layers %>);

Second idea: in site/index.rhtml move the function updateLocation(); above setMapLayers.

Third idea in layouts/site.rhtml duplicating the function updateLocation() in ruby, if you can add "lat=&lon=" to the url created by "link_to"..

comment:3 Changed 10 years ago by Tom Hughes

Resolution: wontfix
Status: newclosed

Given that we can't close the hole completely, and that it's really quite a small hole anyway, I really don't see the point of playing around and risking destabilising the code just to shave a few fractions of a second off the time when the link works.

comment:4 Changed 10 years ago by emj

Ok that was my first choice anyways, just to be clear this "fraction of a second" can be as much as 1-5 seconds depending on load. So if there will ever be a non javascript version of the map on the main page then this might be important, and then only the Ruby solution is important.

Note: See TracTickets for help on using tickets.