Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizing the embedded map #170

Open
mgoebel10 opened this issue Sep 13, 2023 · 5 comments
Open

Customizing the embedded map #170

mgoebel10 opened this issue Sep 13, 2023 · 5 comments

Comments

@mgoebel10
Copy link

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
Copy link
Author

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
Copy link
Owner

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
Copy link

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
Copy link

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

@ankmb1979
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants