|
|
|
@ -80,10 +80,11 @@
@@ -80,10 +80,11 @@
|
|
|
|
|
|
|
|
|
|
var locations = JSON.parse('{{ json.dumps(player.locations_during_game(), cls=location_encoder)|safe }}') |
|
|
|
|
if (locations == null) { |
|
|
|
|
locations = [] |
|
|
|
|
locations = []; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var markers, lastMarker; |
|
|
|
|
var markers = []; |
|
|
|
|
var lastMarker; |
|
|
|
|
updateMarkers(); |
|
|
|
|
var polyline; |
|
|
|
|
updatePolyline(); |
|
|
|
@ -102,13 +103,14 @@
@@ -102,13 +103,14 @@
|
|
|
|
|
}); |
|
|
|
|
markers = [] |
|
|
|
|
} |
|
|
|
|
if(locations.length == 0){ return } |
|
|
|
|
for (var i = 0; i < locations.length -1; i++) { |
|
|
|
|
markers.push(addPlayerMarker(map, locations[i], bluePlayerIconMini)) |
|
|
|
|
} |
|
|
|
|
if(lastMarker != undefined){ |
|
|
|
|
lastMarker.remove() |
|
|
|
|
lastMarker = addPlayerMarker(map, locations[locations.length-1], bluePlayerIcon) |
|
|
|
|
} |
|
|
|
|
lastMarker = addPlayerMarker(map, locations[locations.length-1], bluePlayerIcon) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function updatePolyline(){ |
|
|
|
@ -147,16 +149,12 @@
@@ -147,16 +149,12 @@
|
|
|
|
|
updatePolyline() |
|
|
|
|
updateMarkers() |
|
|
|
|
} |
|
|
|
|
console.log('test1') |
|
|
|
|
//Ajax for Generate Code button |
|
|
|
|
$(function () { |
|
|
|
|
console.log('test2') |
|
|
|
|
$('a#generate_auth_hash').bind('click', function () { |
|
|
|
|
console.log('test3') |
|
|
|
|
$.ajax({ |
|
|
|
|
url: "{{ url_for('auth.generate_auth_hash', username=player.user.name) }}", |
|
|
|
|
success: function (result) { |
|
|
|
|
console.log('test4') |
|
|
|
|
location.reload(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|