diff --git a/public/static/img/compass.svg b/public/static/img/compass.svg new file mode 100644 index 0000000..5662d9e --- /dev/null +++ b/public/static/img/compass.svg @@ -0,0 +1,5 @@ + + + + Sorry, your browser does not support inline SVG. + \ No newline at end of file diff --git a/public/static/js/game.js b/public/static/js/game.js index a21a66c..7f20842 100644 --- a/public/static/js/game.js +++ b/public/static/js/game.js @@ -382,6 +382,10 @@ // needs to be set visible after the show guess map hid it in mobile view document.getElementById("navigation").style.visibility = 'visible'; + + // update the compass + const heading = Game.panorama.getPov().heading; + document.getElementById("compass").style.transform = "rotate(" + heading + "deg)"; }, handleErrorResponse: function (error) { @@ -858,6 +862,9 @@ Game.panorama.addListener('pov_changed', function () { Game.rewriteGoogleLink(); + + const heading = Game.panorama.getPov().heading; + document.getElementById("compass").style.transform = "rotate(" + heading + "deg)"; }); if (COOKIES_CONSENT) { diff --git a/views/game.php b/views/game.php index 5622c85..ff21ae9 100644 --- a/views/game.php +++ b/views/game.php @@ -60,6 +60,14 @@