Ejemplo n.º 1
0
 function unroute() {
     var query = getQuery();
     var rev = reverseRoute();
     if (rev.id && query.id !== rev.id) {
         location.hash = '#' + qs.qsString(rev);
     }
 }
Ejemplo n.º 2
0
L.Hash.prototype.formatHash = function(map) {
    var query = qs.stringQs(location.hash.substring(1)),
        center = map.getCenter(),
            zoom = map.getZoom(),
                precision = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2));

                query.map = [zoom,
                    center.lat.toFixed(precision),
                    center.lng.toFixed(precision)
                ].join('/');

                return '#' + qs.qsString(query);
};