Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Permalink not working until after page load. #1365

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 4 comments
Closed

Permalink not working until after page load. #1365

openstreetmap-trac opened this issue Jul 23, 2021 · 4 comments

Comments

@openstreetmap-trac
Copy link

Reporter: emj
[Submitted to the original trac issue database at 6.39pm, Tuesday, 25th November 2008]

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.

@openstreetmap-trac
Copy link
Author

Author: tom[at]compton.nu
[Added to the original trac issue at 10.51am, Wednesday, 26th November 2008]

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?

@openstreetmap-trac
Copy link
Author

Author: emj
[Added to the original trac issue at 12.49am, Thursday, 27th November 2008]

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 [http://trac.openstreetmap.org/browser/sites/rails_port/app/views/site/index.rhtml 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 [http://trac.openstreetmap.org/browser/sites/rails_port/app/views/layouts/site.rhtml layouts/site.rhtml] duplicating the function updateLocation() in ruby, if you can add "lat=&lon=" to the url created by "link_to"..

@openstreetmap-trac
Copy link
Author

Author: tom[at]compton.nu
[Added to the original trac issue at 8.37am, Thursday, 27th November 2008]

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.

@openstreetmap-trac
Copy link
Author

Author: emj
[Added to the original trac issue at 11.31am, Friday, 28th November 2008]

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant