|
|
@ -4,6 +4,7 @@ |
|
|
|
{{ super() }} |
|
|
|
{{ super() }} |
|
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='assets/leaflet/leaflet.css') }}" /> |
|
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='assets/leaflet/leaflet.css') }}" /> |
|
|
|
<script src="{{ url_for('static', filename='assets/leaflet/leaflet.js') }}"></script> |
|
|
|
<script src="{{ url_for('static', filename='assets/leaflet/leaflet.js') }}"></script> |
|
|
|
|
|
|
|
<script src="{{ url_for('static', filename='assets/geolocation_utils.js') }}"></script> |
|
|
|
{% endblock %} |
|
|
|
{% endblock %} |
|
|
|
|
|
|
|
|
|
|
|
{% block app_content %} |
|
|
|
{% block app_content %} |
|
|
@ -110,6 +111,7 @@ |
|
|
|
objectMarkers.push([objectives[i].latitude, objectives[i].longitude]) |
|
|
|
objectMarkers.push([objectives[i].latitude, objectives[i].longitude]) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var players = JSON.parse('{{ json.dumps(game.last_player_locations(), cls=location_encoder)|safe }}') |
|
|
|
var players = JSON.parse('{{ json.dumps(game.last_player_locations(), cls=location_encoder)|safe }}') |
|
|
|
updatePlayerMarkers() |
|
|
|
updatePlayerMarkers() |
|
|
|
|
|
|
|
|
|
|
@ -129,15 +131,6 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function sendLocation(){ |
|
|
|
|
|
|
|
if (navigator.geolocation) { |
|
|
|
|
|
|
|
navigator.geolocation.getCurrentPosition(postCoordinates, showError); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
console.log('Geolocation is not supported by this browser.') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Poll Locations |
|
|
|
// Poll Locations |
|
|
|
usernames = JSON.parse('{{ json.dumps(game.usernames())|safe }}') |
|
|
|
usernames = JSON.parse('{{ json.dumps(game.usernames())|safe }}') |
|
|
|
setInterval(function() { |
|
|
|
setInterval(function() { |
|
|
@ -148,6 +141,7 @@ |
|
|
|
players, |
|
|
|
players, |
|
|
|
handleResponse |
|
|
|
handleResponse |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
getPosition(updateMyLocation) |
|
|
|
}, 30 * 1000); |
|
|
|
}, 30 * 1000); |
|
|
|
|
|
|
|
|
|
|
|
function handleResponse(data){ |
|
|
|
function handleResponse(data){ |
|
|
|