Skip to content

Instantly share code, notes, and snippets.

@jasondavies
Created December 9, 2010 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasondavies/735185 to your computer and use it in GitHub Desktop.
Save jasondavies/735185 to your computer and use it in GitHub Desktop.
var h = po.hash(), defaultFormat = h.format(), folio = '';
map
.add(po.interact())
.add(po.compass().pan("none"))
.add(h.parse(function(s) {
var args = s.split('/');
folio = args[0];
if (folioLayers[folio]) {
currentLayer.visible(false);
currentLayer = folioLayers[folio].visible(true);
}
return args.slice(1).map(Number)
}).format(function(map) {
return '#' + folio + '/' + defaultFormat(map).substring(1);
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment