configurable hash format #10

wants to merge 1 commit into


None yet

6 participants


I'm using a leaflet map inside a backbone application, and I need the hash to keep my original values. I added a simple option here to allow a "path" option to be passed. Example:

// track the map parameters (zoom/lat/lng) in the URL
var hashed = new L.Hash(myMap, {path: 'map/{z}/{lat}/{lng}'});

you should use L.Util.template that way you can do

hash = L.Util.template(opts.path,{,

I find myself needing this feature also. Any possibility to get this resolved and merged into the master any time soon?

@tmcw tmcw referenced this pull request Dec 21, 2013

Add some params to hash #32


Can't you just override the parseHash and formatHash functions on a L.hash instance?


sorry for the nonsensical comment 😳 , I replied to via email and thought you were talking about a different issue.


I would like this function to be able to permalink certain layers in Layers.control.


Is any of the current forks adding this capability? Doesn’t look like it, but I might have overlooked it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment