- Posts: 227
- Thank you received: 36
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Saving GPS coordinates
- first
- Offline
- Elite Member
Less
More
8 years 2 weeks ago #134489
by first
Survey Designer and Programmer
Replied by first on topic Saving GPS coordinates
I guess most of you already know but just for who don't..
Location from web browser:
#Gives the coordinates of the nearest Internet server respondent is connected to when survey start.
#Respondent will get a prompt in his browser which he has to confirm only then location will get captured.
#This approach will work even if device do not have GPS like laptop / desktop etc.
Location GPS(eg In Mazi offline application ):
#Capture coordinate using mobile GPS system.
#Highly precise
#No internet connectivity required.
It is very frequent requirement CAPI survys to capture GPS location the moment Interview starts. Clients wants it to confirm that interviewers and doing genuine interview.
Location from web browser:
#Gives the coordinates of the nearest Internet server respondent is connected to when survey start.
#Respondent will get a prompt in his browser which he has to confirm only then location will get captured.
#This approach will work even if device do not have GPS like laptop / desktop etc.
Location GPS(eg In Mazi offline application ):
#Capture coordinate using mobile GPS system.
#Highly precise
#No internet connectivity required.
It is very frequent requirement CAPI survys to capture GPS location the moment Interview starts. Clients wants it to confirm that interviewers and doing genuine interview.
Survey Designer and Programmer
The topic has been locked.
- mounabelaid
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
7 years 8 months ago #140862
by mounabelaid
Replied by mounabelaid on topic Saving GPS coordinates
Hello
Would you tell where should I put exactly this script in LimeSurvey?
Would you tell where should I put exactly this script in LimeSurvey?
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
7 years 8 months ago #141009
by Mazi
If you are talking about the OfflineSurveys GPS location tracking feature, that is pretty simple to set up:
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic Saving GPS coordinates
mounabelaid wrote: Hello
Would you tell where should I put exactly this script in LimeSurvey?
If you are talking about the OfflineSurveys GPS location tracking feature, that is pretty simple to set up:
- Go to www.offlinesurveys.com/add-android-multimedia-question
- Download the "GPS location tracking" question/LSQ file from there.
- Import the LSQ file at your survey (this can be done when creating a new question)
- Activate the survey and cache the survey for offline usage
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
- mana
- Offline
- Junior Member
Less
More
- Posts: 24
- Thank you received: 0
7 years 7 months ago #141895
by mana
Replied by mana on topic Saving GPS coordinates
hi
this code don't work in the app
i need code like this for location position . (in offline survey )
thanks
this code don't work in the app
i need code like this for location position . (in offline survey )
thanks
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
7 years 7 months ago #141905
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Saving GPS coordinates
This is not a forum for OfflineSurveys support. Please contact them directly.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
7 years 7 months ago #141907
by Mazi
"Doesn't work" is not an appropriate error description.
- Are there any error messages?
- Which Limesurvey version do you use?
- Which OfflineSurveys version do you use?
- Did you edit the downloaded question? I just tested it and it worked fine for my at the OfflineSurveys app.
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic Saving GPS coordinates
mana wrote: this code don't work in the app
"Doesn't work" is not an appropriate error description.
- Are there any error messages?
- Which Limesurvey version do you use?
- Which OfflineSurveys version do you use?
- Did you edit the downloaded question? I just tested it and it worked fine for my at the OfflineSurveys app.
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
- tpervaiz
- Offline
- Senior Member
Less
More
- Posts: 49
- Thank you received: 1
5 years 8 months ago #172306
by tpervaiz
Replied by tpervaiz on topic Saving GPS coordinates
I used this code which is working perfectly in survey however the coordinates are not showing in response or survey report..Is there anything else I have to do?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
5 years 8 months ago #172310
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Saving GPS coordinates
What LimeSurvey version are you using?
Can you attach an export (.lss) of a small sample survey?
Can you attach an export (.lss) of a small sample survey?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- tpervaiz
- Offline
- Senior Member
Less
More
- Posts: 49
- Thank you received: 1
5 years 8 months ago #172313
by tpervaiz
Replied by tpervaiz on topic Saving GPS coordinates
the version is Version 3.14.2+180807
I am able to get GPS coordinates in both ways Automatically as well as Push button but the problem is the coordinates are not showing in responses and reports
Please see the lss in attachment
Thanks in advance
I am able to get GPS coordinates in both ways Automatically as well as Push button but the problem is the coordinates are not showing in responses and reports
Please see the lss in attachment
Thanks in advance
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
5 years 8 months ago #172314
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Saving GPS coordinates
Try this for the respective scripts:
Sample survey attached:
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var q1ID = '{QID}'; var q1 = $('#question'+q1ID); function getGPS() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showGPS, gpsError); } else { $('input.text', q1).val('No GPS Functionality'); $('input:hidden[id^="answer"]', q1).val('No GPS Functionality'); } } function gpsError(error) { alert('GPS Error: '+error.code+', '+error.message); } function showGPS(position) { $('input.text', q1).val(position.coords.latitude+', '+position.coords.longitude); $('input:hidden[id^="answer"]', q1).val(position.coords.latitude+';'+position.coords.longitude); } getGPS(); }); </script>
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var q1ID = '{QID}'; var q1 = $('#question'+q1ID); // Click event for the button $('.gpsLink').click(function(){ getGPS(); }); function getGPS() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showGPS, gpsError); } else { $('input.text', q1).val('No GPS Functionality'); $('input:hidden[id^="answer"]', q1).val('No GPS Functionality'); } } function gpsError(error) { alert('GPS Error: '+error.code+', '+error.message); } function showGPS(position) { $('input.text', q1).val(position.coords.latitude+', '+position.coords.longitude); $('input:hidden[id^="answer"]', q1).val(position.coords.latitude+';'+position.coords.longitude); } }); </script>
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The following user(s) said Thank You: DenisChenu, tpervaiz, DavidPausDD
The topic has been locked.
- tpervaiz
- Offline
- Senior Member
Less
More
- Posts: 49
- Thank you received: 1
5 years 8 months ago #172315
by tpervaiz
Replied by tpervaiz on topic Saving GPS coordinates
GPS coordinates are not even showing in survey itself by using the script provided by you
Do I need more workaround?
Do I need more workaround?
Attachments:
The topic has been locked.
- tpervaiz
- Offline
- Senior Member
Less
More
- Posts: 49
- Thank you received: 1
5 years 8 months ago #172316
by tpervaiz
Replied by tpervaiz on topic Saving GPS coordinates
Its working now,, I copied half script
Thanks alottttt
Thanks alottttt
The topic has been locked.