Skip to content
Snippets Groups Projects
Verified Commit 248cb930 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Implement retrieval of latitude and longitude for checkpoint

parent 18e38fa8
No related branches found
No related tags found
1 merge request!30Resolve "Checkpoint system"
Pipeline #76030 failed
......@@ -504,6 +504,9 @@ class PersonGroupFormPerson(forms.Form):
class EventCheckpointForm(forms.Form):
class Media:
js = ("js/paweljong/checkpoint.js",)
layout = Layout("username")
comment = forms.CharField(
......@@ -525,7 +528,7 @@ class EventCheckpointForm(forms.Form):
max_value=90.0,
max_digits=8,
decimal_palces=6,
widget=forms.HiddenInput()
# widget=forms.HiddenInput()
)
lon = forms.DecimalField(
required=False,
......@@ -533,5 +536,5 @@ class EventCheckpointForm(forms.Form):
max_value=180.0,
max_digits=9,
decimal_palces=6,
widget=forms.HiddenInput()
# widget=forms.HiddenInput()
)
function setCheckpointCoords(position) {
$("[name='lat']").value = position.coords.latitude;
$("[name='lon']").value = position.coords.longitude;
}
$(document).ready(function($) {
if (navigator.geolocation) {
window.setInterval(function() {
navigator.geolocation.getCurrentPosition(setCheckpointCoords);
})
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment