use .toFixed() instead of manual math

This commit is contained in:
Hannes
2020-09-25 22:10:25 +02:00
committed by GitHub
parent 47ae47d123
commit 2e87ae3421

View File

@@ -45,11 +45,11 @@ const updatePermalink = function () {
const center = view.getCenter(); const center = view.getCenter();
const hash = const hash =
'#map=' + '#map=' +
view.getZoom() + view.getZoom().toFixed(2) +
'/' + '/' +
Math.round(center[0] * 100) / 100 + center[0].toFixed(2) +
'/' + '/' +
Math.round(center[1] * 100) / 100 + center[1].toFixed(2) +
'/' + '/' +
view.getRotation(); view.getRotation();
const state = { const state = {