Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endless redirects #12

Open
stevevance opened this issue Jan 3, 2013 · 1 comment
Open

Endless redirects #12

stevevance opened this issue Jan 3, 2013 · 1 comment

Comments

@stevevance
Copy link

I referenced leaflet-hash.js and added var hash = new L.Hash(map); after initializing the map. Upon the first loading of the page, the page loads the UI, loads the map, and then goes blank as the browser gets in an endless loop.

I think this may have something to do with jQueryMobile (I get a jQueryMobile-provided "error loading" on-screen message). Let me know if you need me to go into more details or provide a screencast of the loop.

@stevevance
Copy link
Author

Update: jQueryMobile is messing this up because it is listening to hash changes and trying to do something about the changing hash. It can be disabled with

$(document).bind("mobileinit", function(){
    $.mobile.hashListeningEnabled = false;
});

But, a problem isn't gone completely.

Here's what happens:

  1. The map loads: http://localhost/map.html
  2. The URL immediately changes to http://localhost/14/41.8821/-87.6278
  3. I move the map and then the page reloads and the URL is now http://localhost/map.html#14/41.8883/-87.6488
  4. I move the map again and the URL changes to http://localhost/14/41.8968/-87.6736
  5. I move the map a third time and the page reloads and the URL is now http://localhost/map.html#14/41.9086/-87.6832

I was able to use the Permalink plugin which I believe provides an identical function. It worked properly in my webpage.

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

No branches or pull requests

1 participant