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