keita-makino / qualtrics-map

Google Maps integration into Qualtrics.
MIT License
22 stars 1 forks source link

Customizing the embedded map #170

Open mgoebel10 opened 1 year ago

mgoebel10 commented 1 year ago

Hi! I used an older version of your code to embed a map (in 2021 and 22), but struggling with the latest version. I think part of the issue might be that Qualtrics has also updated? Anyway, I'm trying to customize where the map default view is (ideally I'd like it to show the state of Montana). The directions are a little different than they were before (e.g. do you still have to convert the bundle file?). I'm not at all familiar with Javascript (beyond working with the code you provided). Thanks!

mgoebel10 commented 1 year ago

Are these directions missing something?

. Upload the text file.

  1. Click the gear icon at the right of the uploaded file and select "Rename File".
  2. Select the uploaded file and click "View" button.
  3. Copy the URL of the file opened in the new window.
  4. Copy the URL of the file opened in the new window and proceed to "Header settings".
keita-makino commented 1 year ago

Hi @mgoebel10, sorry for a late reply.

As you referred to, I think Qualtrics has updated its policy or the handling process, so it seems they no longer (easily) accept external .js files, as I have reviewed it a while ago.

But for your main goal to customize the default view, you can just use the CDN approach and then use the last example in the readme with the optional parameters.

Qualtrics.SurveyEngine.addOnReady(function () {
  mapRender(apiKeyGoogleMap, document.getElementById(this.questionId), {
    location: {
      lat: 50,
      lng: -100,
    },
    zoom: 12, // Optional
  });
});
jsozaparra commented 11 months ago

Hey @keita-makino, again, thanks for developing this tool! Everything is working just fine for me, but I can not make the zoom attribute to work. I thought mapRender was a Google API function, but it seems it is something you developed, so I am not sure what might be the reason for it to not work (lat and lng work great)

vandeynze commented 4 months ago

@keita-makino Following up on this. The "zoom" attribute doesn't seem to be working properly. Otherwise, thank you for this great tool!

ankmb1979 commented 4 months ago

I agree: I cannot get the zoom feature to work either. Thank you!