MAPG-203 adapt game.js to the new endpoints
default-pipeline default-pipeline #15

This commit is contained in:
bence committed 2021-03-15 12:28:25 +01:00
1 parent 9c4b7448a9
commit c317a0abf4
1 file changed
+10 -5
+10 -5
View File
@@ -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);
},