Created
August 19, 2016 17:46
-
-
Save benwaffle/c61d0fb29ced1f7bacdfdd4dc28229fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
socket.on('new_turn', data => { | |
fetch(`https://maps.googleapis.com/maps/api/geocode/json?address="${data.city}, ${data.country}"`) | |
.then(res => res.json()) | |
.then(data => { | |
const loc = data.results[0].geometry.location | |
createMarker(loc.lat, loc.lng, 'blue') | |
socket.emit('answer', gameId, loc.lat, loc.lng) | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment