Bienvenue, Invité
Nom d'utilisateur : Mot de passe : Se souvenir de moi
  • Page :
  • 1
  • 2

SUJET : Saving GPS coordinates

Saving GPS coordinates il y a 2 mois 2 semaines #118197

  • dgtano
  • Portrait de dgtano
  • Hors ligne
  • Fresh Lemon
  • Messages : 2
  • Karma: 0
Fantastic. Tks a lot
L'administrateur a désactivé l'accès en écriture pour le public.

Saving GPS coordinates il y a 2 mois 4 jours #118541

  • shawnchan
  • Portrait de shawnchan
  • Hors ligne
  • Fresh Lemon
  • Messages : 5
  • Karma: 0
Hello,

Thank you very much for your effort, it looks like everybody else can work it out with your sample survey. I also tried to do it with your sample survey [limesurvey_survey_geolocation.lss ], but nothing shows in the text box after clicking the button, although a pop-up window shows up and asking for permission to get the location. Do you have any idea on this? I can get the location in Google map so I guess it's not the signal problem.

I also tried it on both android device and IPAD but it's still not working.

Thanks a lot.

LimeSurvey: Version 1.91+ Build 11379
Dernière édition: il y a 2 mois 4 jours par shawnchan.
L'administrateur a désactivé l'accès en écriture pour le public.

Saving GPS coordinates il y a 2 mois 4 jours #118554

  • tpartner
  • Portrait de tpartner
  • Hors ligne
  • LimeSurvey Team
  • Messages : 4846
  • Remerciements reçus 989
  • Karma: 417
The survey was developed for LS 2+. Please upgrade your installation.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
L'administrateur a désactivé l'accès en écriture pour le public.

Saving GPS coordinates il y a 2 mois 4 jours #118555

  • shawnchan
  • Portrait de shawnchan
  • Hors ligne
  • Fresh Lemon
  • Messages : 5
  • Karma: 0
Thanks for you reply. Is there any way I can get the GPS coordinates without an upgrade?

I tried to copy the two functions getGPS and showGPS to the lss file by the version 1.91 and then import back to LS but no luck..is there any way you can help to modify the lss file attached? It would be great if the lime survey can automatically save the GPS coordinates and store the coordinates as a variable.

I am attaching a sample survey generated by limesurvey Version 1.91+ Build 11379.
L'administrateur a désactivé l'accès en écriture pour le public.

Saving GPS coordinates il y a 2 mois 4 jours #118557

  • tpartner
  • Portrait de tpartner
  • Hors ligne
  • LimeSurvey Team
  • Messages : 4846
  • Remerciements reçus 989
  • Karma: 417
I'm sorry, I cannot develop or test for 1.92 - it's too old.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
L'administrateur a désactivé l'accès en écriture pour le public.

Saving GPS coordinates il y a 2 mois 4 jours #118564

  • holch
  • Portrait de holch
  • Hors ligne
  • LimeSurvey Team
  • Messages : 3459
  • Remerciements reçus 475
  • Karma: 151
@tpartner: And it is not even 1.92, it is 1.91, even older...
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
L'administrateur a désactivé l'accès en écriture pour le public.

Saving GPS coordinates il y a 2 mois 2 jours #118589

  • shawnchan
  • Portrait de shawnchan
  • Hors ligne
  • Fresh Lemon
  • Messages : 5
  • Karma: 0
Oh..I guess I have to upgrade Limesurvey before asking for help again.

Thanks again for your advise.
L'administrateur a désactivé l'accès en écriture pour le public.

Saving GPS coordinates il y a 1 mois 2 semaines #118976

  • shawnchan
  • Portrait de shawnchan
  • Hors ligne
  • Fresh Lemon
  • Messages : 5
  • Karma: 0
I used your scripts on demo version of limesurvey and I can get the GPS coordinates now. The GPS coordinates is automatically shown the text box when I open the survey. Thanks tpartner for that.

What I'm trying to do now is to use the GPS function as a measure of quality control, making sure that they have done the interviews at the correct location.

Is there any way we can "secretly" store the GPS coordinates without noticing the users? because now GPS coordinates is shown on screen and even can be edited by users. I tried to do it by hiding the questions but I can't get the GPS coordinates when the question is hidden.
L'administrateur a désactivé l'accès en écriture pour le public.

Saving GPS coordinates il y a 1 mois 2 semaines #118981

  • tpartner
  • Portrait de tpartner
  • Hors ligne
  • LimeSurvey Team
  • Messages : 4846
  • Remerciements reçus 989
  • Karma: 417
You cannot manipulate a question that is hidden with the advanced question settings.

Try hiding the question with JavaScript.

<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function(){
 
		// Identify this question
		var q1ID = '{QID}';
		var q1 = $('#question'+q1ID);
 
		// Hide this question
		q1.hide();
 
		function getGPS() {
			if (navigator.geolocation) {  
				navigator.geolocation.getCurrentPosition(showGPS, gpsError);
			} else {  
				$('input.text', 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);
		}
 
		getGPS();
 
	});
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
L'administrateur a désactivé l'accès en écriture pour le public.

Saving GPS coordinates il y a 1 mois 2 semaines #119032

  • shawnchan
  • Portrait de shawnchan
  • Hors ligne
  • Fresh Lemon
  • Messages : 5
  • Karma: 0
It's works perfectly now!!! Thanks a lot!
L'administrateur a désactivé l'accès en écriture pour le public.
  • Page :
  • 1
  • 2
Modérateurs: ITEd
Temps de génération de la page : 0.152 secondes
Donation Image