How do I embed a google map in my google form so users can select a location and autofill a lat/long box?

22,675 views
Skip to first unread message

Sir Loin of Beef

unread,
Feb 9, 2011, 6:28:49 PM2/9/11
to Google Maps JavaScript API v3
I am trying to create a google form with a map that focuses on a
country (Japan in this case), which allows users to find a location in
Japan, click on it, and have a lattitude and longitude box on the form
automatically filled up.

I found this site:
http://googlemapsapi.blogspot.com/2008/02/creating-user-contributed-map-look-ma.html
which states "To do this, we create a map and then assign an event
listener for the map 'click' event that writes the values of the
clicked coordinate into the form input fields. The code that
accomplishes that is shown below: "

but it doesn't show how to add an event listener. Should I be adding
the listener to the form, or the map, and how do I add it?

In addition, I'm also trying to create a google map of points based on
the lattitudes and longitudes in a google spreadsheet, but the google
wizard doesn't seem to work anymore as the auth key seems too long. Is
there any updated wizard for this?


I'm totally new to this, so is anyone able to walk me through?


Chris Broadfoot

unread,
Feb 9, 2011, 6:34:35 PM2/9/11
to google-map...@googlegroups.com
On Thu, Feb 10, 2011 at 10:28 AM, Sir Loin of Beef <sau...@gmail.com> wrote:
but it doesn't show how to add an event listener. Should I be adding
the listener to the form, or the map, and how do I add it?


Read here:

http://code.google.com/apis/maps/documentation/javascript/events.html
http://code.google.com/apis/maps/documentation/javascript/reference.html#event

As to your other question, I don't know what wizard you're talking about. Could you link me to it please?

Chris

Sir Loin of Beef

unread,
Feb 16, 2011, 7:36:49 AM2/16/11
to Google Maps JavaScript API v3

Sir Loin of Beef

unread,
Feb 16, 2011, 7:42:08 AM2/16/11
to Google Maps JavaScript API v3
By the way can these event handlers be added to a google spreadsheets
form? I'm trying to keep everything hosted on google itself.

Shreerang Patwardhan

unread,
Feb 18, 2011, 6:56:43 AM2/18/11
to google-map...@googlegroups.com
You can check out examples here:

http://shreerangpatwardhan.blogspot.com/2010/11/playing-with-markers-and-info-window.html

http://shreerangpatwardhan.blogspot.com/2010/11/form-info-window.html

http://shreerangpatwardhan.blogspot.com/2010/12/retriving-co-ordinates.html

Hope these examples prove useful for some part of your query.

HTH.

On Wed, Feb 16, 2011 at 6:12 PM, Sir Loin of Beef <sau...@gmail.com> wrote:
By the way can these event handlers be added to a google spreadsheets
form? I'm trying to keep everything hosted on google itself.

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.




--
Regards,
Shreerang Patwardhan.

Sir Loin of Beef

unread,
Feb 18, 2011, 11:35:37 AM2/18/11
to Google Maps JavaScript API v3
Thank you, these examples are nicely done and very useful.

However, can they be used in google-hosted forms? Google sites seems
to strip out all <script> codes so that will cause a problem.
Reply all
Reply to author
Forward
0 new messages