Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Let respondent search address on GoogleMaps or Openstreetmap

  • Gabrielle_Claing_DADS
  • Gabrielle_Claing_DADS's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 1 month ago #245526 by Gabrielle_Claing_DADS
Please help us help you and fill where relevant:
Your LimeSurvey version:  LimeSurvey Cloud  Version 5.6.31
Own server or LimeSurvey hosting: 
Survey theme/template:
==================
Limesurvey's location tool is not user-friendly enough for my needs, since you can only search for a city. I would like the respondent to be able to fill in a search bar (preferably with autofill option) with their address or postal code and have the location appear on the map so they can adjust if needed. I found the solution in an old topic , but the .lss file attachment suggested by tpartner is no longer available and the topic has been locked. Has anyone ever prepared a similar question and could share a .lss file that could save me a lot of hassle? Although I'm familiar with coding in other circumstances, I haven't done it in the limesurvey platform and don't have much time to work on a trial-and-error solution...

Thanks!

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 1 month ago #245536 by tpartner
Did you try the code provided in the linked post?

Cheers,
Tony Partner

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

Please Log in to join the conversation.

  • Gabrielle_Claing_DADS
  • Gabrielle_Claing_DADS's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 1 month ago #245544 by Gabrielle_Claing_DADS
Replied by Gabrielle_Claing_DADS on topic Let respondent search address on GoogleMaps or Openstreetmap
Yes, I did try to import the .lss file provided by b1994mi and change the code in the question (through the "<>source" option) for the one you provided after, but somehow the map didn't even appear when I tested the question, and when I went back to check the code, it didn't appear as I pasted it. So I assume I'm doing something wrong, but I don't have enough knowledge about this to have an idea where to start, sadly. I didn't change anything to the format/options of the question provided by b1994mi, I don't know if there was a problem there.
Attachments:

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 1 month ago #245545 by tpartner
Do you have permissions to insert JavaScript?

- manual.limesurvey.org/Workarounds:_Manip...tc..29_in_LimeSurvey

Cheers,
Tony Partner

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

Please Log in to join the conversation.

  • Gabrielle_Claing_DADS
  • Gabrielle_Claing_DADS's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 1 month ago #245547 by Gabrielle_Claing_DADS
Replied by Gabrielle_Claing_DADS on topic Let respondent search address on GoogleMaps or Openstreetmap
Although I was able to turn the XSS filter off in the Global settings, the plugin addScriptToQuestion is not installed on the server, so I couldn't activate it. Is that necessary to do Javascript? I work at a government that outsourced the server administration for limesurvey, so I don't know if I can add the plugin to the server.

Now the code appears correctly in the source window when editing the question, even after saving the question. But there is still no map that appears when I test the question.

Thanks a lot for your help!

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 1 month ago #245548 by holch
Afaik you do not need the plugin "addScriptToQuestion" to be able to add scripts to the question. This is just a way to seperate the question text from the script, which makes things a little cleaner.

But with the XSS filter switched off, you should be able to use Javascript in your installation, by including it into the field for the question text, for example. However, make sure you are not using the WYSIWYG editor or if you are using it, that you include the script in the source code view of the editor.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 1 month ago #245550 by holch
By the way, did you insert your Google Maps API key into the script?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

  • Gabrielle_Claing_DADS
  • Gabrielle_Claing_DADS's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 1 month ago #245552 by Gabrielle_Claing_DADS
Replied by Gabrielle_Claing_DADS on topic Let respondent search address on GoogleMaps or Openstreetmap
Thanks for the reply! So, no, I did not, and thanks for checking the basics with me. I googled this quickly, and I don't know if we use Google Maps Platform in our government, and if I could even get an API key... don't really wish to do this on my personnal account! I'll ask, but I might have dreamed too big on this one :(

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose