Skip to content
This repository was archived by the owner on Dec 21, 2017. It is now read-only.

Commit cb39c7e

Browse files
committed
Merge PR #2: avoid cluttering browser history
2 parents bd85f51 + 45b698c commit cb39c7e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Files/index_html.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ var CustomMapType = new CustomMapType();
5959
function update_url() {
6060
var center = map.getCenter();
6161
var zoom = map.getZoom();
62+
var href = location.href;
6263
63-
window.location.hash = '#' + center.lat().toFixed(2) + ',' + center.lng().toFixed(2) + ',' + zoom;
64+
href = href.split("#")[0] || href;
65+
href = encodeURI(href);
66+
window.location.replace(href + '#' + center.lat().toFixed(2) + ',' + center.lng().toFixed(2) + ',' + zoom);
6467
}
6568
6669
function hash_changed() {

0 commit comments

Comments
 (0)