pkmnct / qualtrics-google-map-lat-long

Embed a customizable Google Map in your Qualtrics survey to collect location data
MIT License
21 stars 13 forks source link

Qualtrics Google Map with Loop and Merge #23

Open BenjaGramsch opened 2 years ago

BenjaGramsch commented 2 years ago

Hi, I have been working with the Javascript script that displays a Google Maps and collect the coordinates of the location, the code works perfectly, but I tried to add it to a Loop and Merge and now the map doesn't display anymore.

Here is a picture of how it looks when the map is on the Loop and Merge image

This is the code I'm using

`Qualtrics.SurveyEngine.addOnload(function() { initGoogleMapsQuestion("#"+this.questionId, this.getQuestionContainer(), { // Map Options, set these! See Map Options in Option Documentation Section options: { center: { lat: 47.377749, lng: 8.540780,
}, zoom: 10, }, // Marker Options, set these! markers: [ // First Marker { // See Marker Options in Option Documentation Section options: { title: "Location", draggable: true, label: "1", }, autocomplete: { // If true, an autocomplete will show. enabled: true, // The label shown for the autocomplete field label: "Residence location", // Styles for the label labelCss: "padding-left: 0; padding-right: 0;", // Text to show if an invalid location is selected invalidLocationAlertText: "Please choose a location from the search dropdown. If your location doesn't appear in the search, enter a nearby location and move the marker to the correct location.", }, },

], }); });

Qualtrics.SurveyEngine.addOnReady(function() { /Place your JavaScript here to run when the page is fully displayed/

});

Qualtrics.SurveyEngine.addOnUnload(function() { /Place your JavaScript here to run when the page is unloaded/

});`

harsh7595 commented 1 year ago

I have the same issue. Any solution to this problem?

pkmnct commented 1 year ago

Could you check to see if there are any console errors or warnings in your browser when the map should be rendering? I anticipate there's something that will have to be changed with the render logic on a loop and merge question.