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); },