MCPcopy Create free account
hub / github.com/c3bottles/c3bottles / updateHash

Function updateHash

js/view/map.js:27–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25}
26
27const updateHash = function() {
28 let hash =
29 `#${map.getLevel()}/${mapObj.getCenter().lat.toPrecision(7)}` +
30 `/${mapObj.getCenter().lng.toPrecision(7)}/${mapObj.getZoom()}`;
31
32 if (map.getCategory() > -1) {
33 hash += `/${map.getCategory()}`;
34 }
35
36 location.hash = hash;
37}
38
39mapObj.on('moveend', updateHash);
40mapObj.on('zoomend', updateHash);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected