From c317a0abf42bbec6c5e02c9c0864070e7500102f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Mon, 15 Mar 2021 12:28:25 +0100 Subject: [PATCH] MAPG-203 adapt game.js to the new endpoints --- public/static/js/game.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/public/static/js/game.js b/public/static/js/game.js index de9098b..f02d1f8 100644 --- a/public/static/js/game.js +++ b/public/static/js/game.js @@ -26,7 +26,7 @@ }); Game.map.fitBounds(mapBounds); - MapGuesser.httpRequest('GET', '/game/' + mapId + '/newPlace.json', function () { + MapGuesser.httpRequest('GET', '/game/' + mapId + '/initialData.json', function () { document.getElementById('loading').style.visibility = 'hidden'; document.getElementById('panoCover').style.visibility = 'hidden'; @@ -35,8 +35,8 @@ return; } - Game.panoId = this.response.panoId; - Game.pov = this.response.pov; + Game.panoId = this.response.place.panoId; + Game.pov = this.response.place.pov; if (this.response.history) { for (var i = 0; i < this.response.history.length; ++i) { @@ -200,8 +200,13 @@ document.getElementById('showSummaryButton').style.display = 'block'; } - Game.panoId = this.response.panoId; - Game.pov = this.response.pov; + if (this.response.newPlace) { + Game.panoId = this.response.newPlace.panoId; + Game.pov = this.response.newPlace.pov; + } else { + Game.panoId = null; + Game.pov = null; + } }, data); },