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

Maps API explain and extension to location duration #24

Open Zhuhan-J opened 1 year ago

Zhuhan-J commented 1 year ago

Hello George,

Your codes are so helpful and I can successfully implement them in qualtircs. I just have some understanding questions about the codes and wondering how can I extend it.

  1. What is the method initGoogleMapsQuestion()? I cannot see any function explanation for it on google maps documentation and wondering why it works without calling initialize map?
  2. I would like to extend it and with the given inputs try find the direction and time duration of the public transport. is there a way to figure it out?

Many thanks!

pkmnct commented 1 year ago

Hey Zhuhan,

The initGoogleMapsQuestion is defined in src/QualtricsGoogleMap.ts. You can adjust how it works in that file, and run npm install and npm run build to compile the TypeScript for the browser.

As far as getting the direction and time duration of public transport, I would check out https://developers.google.com/maps/documentation/javascript/directions#TransitOptions