Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pkmnct committed Mar 13, 2019
1 parent de15d08 commit c1faa5c
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Qualtrics Google Map Lat/Long Collector

## NOTE
To use the updated code, you must replace it in all questions in your survey. If an older version of the code is running in another question, the map may not display.

#### Getting Started
Create or open a Qualtrics survey. You must be able to add JavaScript to a question for this code to work (it will not work on trial accounts where this feature is unavailable).

Expand All @@ -13,15 +10,15 @@ On the left side of the question, click the gear and select _Add JavaScript..._

Select everything in the box and clear it. The JavaScript box should be empty before pasting the code.

Copy the JavaScript from the [file](https://github.com/pkmnct/qualtrics-google-map-lat-long/blob/master/QualtricsGoogleMapLatLong.js) and paste it in the box.
Copy the JavaScript from the [file](https://github.com/pkmnct/qualtrics-google-map-lat-long/blob/master/QualtricsGoogleMapLatLong.js) and paste it in the box. You can also get older versions of the code from [releases](https://github.com/pkmnct/qualtrics-google-map-lat-long/releases).

At the top of the pasted code, find the section labeled _Enter your Google Map API key in this variable._

Replace the text _Your Key_ with your own API key (see the Google Maps documentation _[Get API Key](https://developers.google.com/maps/documentation/javascript/get-api-key)_).
Replace the text _Your Key_ with your own API key. You must enable the Maps JavaScript API, and if you are using the Autocomplete Field, you must also enable the Places API (see Google's documentation: _[Get Maps JavaScript API Key](https://developers.google.com/maps/documentation/javascript/get-api-key)_ and _[Get Places API Key](https://developers.google.com/places/web-service/get-api-key)_).

Scroll down to the section labeled _Variables_ and edit the variables as needed.

Click Save. Test the question before sending out the survey.
Click Save. Test the question before sending out the survey. If you have any issues, see _Troubleshooting_ below.

#### Using the Question
By default, an autocomplete field is created to assist in finding a location. Responders can enter a location into this field and the map will snap its marker to that location. They can then fine-tune the response by dragging the marker to a specific location (such as a door to a building).
Expand All @@ -31,3 +28,20 @@ If you would like to disable the autocomplete field, set the variable _enableAut
The result is collected in the Qualtrics question field as a JSON object. It will be in the format as follows:

`{"lat": "38.8951", "long": "-77.0364"}`

#### Updating with New Releases
When a [new version of the code is released](https://github.com/pkmnct/qualtrics-google-map-lat-long/releases), you should replace the code in all questions that use it. If different versions of the code are used in the same survey, you may run into issues. Make sure to note any variable changes you had made.

#### Troubleshooting

##### The map doesn't show after adding it to the question
The map will only show up in the actual survey, not in the back-end of Qualtrics. Try to preview or take the survey.

##### The map only shows on the first question
This is a known issue with earlier versions of the code. Update the code in **all questions** that use it.

##### The map or autocomplete field search shows "_This page can't load Google Maps correctly_" or "_For development purposes only_"
This usually indicates an issue with your API key. Make sure you set the API key variable. Check that the API key has access to both the Maps JavaScript API, and if you are using the Autocomplete Field, the Places API. If you are still having trouble, follow [Google's API key troubleshooting steps](https://developers.google.com/maps/documentation/javascript/error-messages).

##### I'm still having problems
Make sure you are using the latest version of the code (see _Updating with New Releases_ above). If that doesn't help, see if an [issue](https://github.com/pkmnct/qualtrics-google-map-lat-long/issues) has been created for the problem you are facing already. If not, you can [create a new issue](https://github.com/pkmnct/qualtrics-google-map-lat-long/issues).

0 comments on commit c1faa5c

Please sign in to comment.