Using Google Maps with Qualtrics | XM Community
Solved

Using Google Maps with Qualtrics

  • 6 April 2018
  • 4 replies
  • 367 views

Hi.

I would like to use the Google Maps API in one of my questions in a Qualtrics survey. I would also like to record the latitude/longitude information of the address that the respondent puts on the map.

I found some publicly available code that does (almost) exactly what I need to do: https://github.com/pkmnct/qualtrics-google-map-lat-long However, what this code doesn't do is include a search box where respondents can type an address. This is important for me because I would like my respondents to be able to type an address rather than having to move the pin around.

In short, what I need help with is EITHER modifying the code in the GitHub repository to include a search box OR writing some other code from scratch that does everything that I need.

Thanks.
icon

Best answer by Matt_Christie_Walker 12 April 2018, 00:02

View original

4 replies

Userlevel 4
Badge +5
@GradStudent ,

When I load in the latest copy of the code you linked, I do see a search box where respondents can type an address. The code was last updated April 7. Do you have the latest copy?
Yes. I actually contacted the owner of the repo directly who kindly revised his code to suit my needs. Sorry, I didn't let the Qualtrics Community know about this... Thank you for responding to my question though!
The code seems to work very well.

But I am wondering how the starting area shown in the map (or specifically, the "first" thing typed into the search text box) could be set by answers entered by the respondent in an earlier question. Essentially, I need to pipe the respondent's answer to a previous question ("type city name below" for example) into the search text box for the map question.

How to pipe in a value from a previous question into a text box that is created through JavaScript?

Thanks.
Badge +1

Hi everyone,
I tried to integrate the code from the link you attached, but unfortunately, it doesn't work.
I placed the text Your Key with a valid API key (I have a billing account in google).
When I ran the question with this JS script, I managed to see the map, but after a few seconds the following error message appeared:
Do you have any idea what I missed here? 
Thanks a lot!!
Shir

Leave a Reply