MAPG-20 rename guessMap to map

This commit is contained in:
Bence Pőcze 2020-05-22 23:23:54 +02:00
parent 96ee250f96
commit f110bb9b18
3 changed files with 18 additions and 18 deletions

View File

@ -101,12 +101,12 @@ div.buttonContainer.bottom {
display: none; display: none;
} }
#guessMap { #map {
width: 100%; width: 100%;
border-radius: 3px; border-radius: 3px;
} }
#guess.result > #guessMap { #guess.result > #map {
height: 70%; height: 70%;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
@ -182,7 +182,7 @@ div.buttonContainer.bottom {
visibility: hidden; visibility: hidden;
} }
#guessMap { #map {
height: calc(100% - 90px); height: calc(100% - 90px);
} }
@ -223,7 +223,7 @@ div.buttonContainer.bottom {
display: none; display: none;
} }
#guessMap { #map {
height: calc(100% - 45px); height: calc(100% - 45px);
} }

View File

@ -9,7 +9,7 @@
scoreSum: 0, scoreSum: 0,
realPosition: null, realPosition: null,
panorama: null, panorama: null,
guessMap: null, map: null,
guessMarker: null, guessMarker: null,
adaptGuess: false, adaptGuess: false,
googleLink: null, googleLink: null,
@ -77,10 +77,10 @@
document.getElementById('guess').style.visibility = null; document.getElementById('guess').style.visibility = null;
document.getElementById('guess').classList.remove('result') document.getElementById('guess').classList.remove('result')
Core.guessMap.setOptions({ Core.map.setOptions({
draggableCursor: 'crosshair' draggableCursor: 'crosshair'
}); });
Core.guessMap.fitBounds(guessMapBounds); Core.map.fitBounds(guessMapBounds);
Core.startNewRound(); Core.startNewRound();
}, },
@ -157,10 +157,10 @@
resultBounds.extend(Core.realPosition); resultBounds.extend(Core.realPosition);
resultBounds.extend(guessPosition); resultBounds.extend(guessPosition);
Core.guessMap.setOptions({ Core.map.setOptions({
draggableCursor: 'grab' draggableCursor: 'grab'
}); });
Core.guessMap.fitBounds(resultBounds); Core.map.fitBounds(resultBounds);
document.getElementById('distance').innerHTML = Util.printDistanceForHuman(distance); document.getElementById('distance').innerHTML = Util.printDistanceForHuman(distance);
document.getElementById('score').innerHTML = score; document.getElementById('score').innerHTML = score;
@ -180,7 +180,7 @@
var round = Core.rounds[Core.rounds.length - 1]; var round = Core.rounds[Core.rounds.length - 1];
round.realMarker = new google.maps.Marker({ round.realMarker = new google.maps.Marker({
map: Core.guessMap, map: Core.map,
visible: !hidden, visible: !hidden,
position: realPosition, position: realPosition,
clickable: true, clickable: true,
@ -192,7 +192,7 @@
}); });
round.guessMarker = new google.maps.Marker({ round.guessMarker = new google.maps.Marker({
map: Core.guessMap, map: Core.map,
visible: !hidden, visible: !hidden,
position: guessPosition, position: guessPosition,
clickable: false, clickable: false,
@ -207,7 +207,7 @@
}); });
round.line = new google.maps.Polyline({ round.line = new google.maps.Polyline({
map: Core.guessMap, map: Core.map,
visible: !hidden, visible: !hidden,
path: [ path: [
realPosition, realPosition,
@ -275,7 +275,7 @@
resultBounds.extend(round.guessPosition); resultBounds.extend(round.guessPosition);
} }
Core.guessMap.fitBounds(resultBounds); Core.map.fitBounds(resultBounds);
document.getElementById('scoreSum').innerHTML = Core.scoreSum; document.getElementById('scoreSum').innerHTML = Core.scoreSum;
@ -363,16 +363,16 @@
Core.adaptGuess = true; Core.adaptGuess = true;
} }
Core.guessMap = new google.maps.Map(document.getElementById('guessMap'), { Core.map = new google.maps.Map(document.getElementById('map'), {
disableDefaultUI: true, disableDefaultUI: true,
clickableIcons: false, clickableIcons: false,
draggableCursor: 'crosshair', draggableCursor: 'crosshair',
draggingCursor: 'grabbing' draggingCursor: 'grabbing'
}); });
Core.guessMap.fitBounds(guessMapBounds); Core.map.fitBounds(guessMapBounds);
Core.guessMap.addListener('click', function (e) { Core.map.addListener('click', function (e) {
if (Core.rounds[Core.rounds.length - 1].guessPosition) { if (Core.rounds[Core.rounds.length - 1].guessPosition) {
return; return;
} }
@ -383,7 +383,7 @@
} }
Core.guessMarker = new google.maps.Marker({ Core.guessMarker = new google.maps.Marker({
map: Core.guessMap, map: Core.map,
position: e.latLng, position: e.latLng,
clickable: false, clickable: false,
draggable: true, draggable: true,

View File

@ -19,7 +19,7 @@
<div id="closeGuessButtonContainer" class="buttonContainer top"> <div id="closeGuessButtonContainer" class="buttonContainer top">
<button id="closeGuessButton" class="block gray">Close</button> <button id="closeGuessButton" class="block gray">Close</button>
</div> </div>
<div id="guessMap"></div> <div id="map"></div>
<div id="guessButtonContainer" class="buttonContainer bottom"> <div id="guessButtonContainer" class="buttonContainer bottom">
<button id="guessButton" class="block" disabled>Guess</button> <button id="guessButton" class="block" disabled>Guess</button>
</div> </div>