Finding location using zip code

1,131 views
Skip to first unread message

Jesse Rice

unread,
May 23, 2011, 1:33:52 AM5/23/11
to Google Maps JavaScript API v3
Hi, I'm running into a very simple problem involving the maps api.

I have a blank html page with a single text box form to accept a zip
code. When the user clicks submit, they should be taken to a new page
showing the zip code location on a map. I have followed the "Hello
World" example on the tutorial page, however when determining the
latitude and longitude, it uses a pre-existing set of coordinates, and
not a zip code.

I found an example that is extremely close to what I am trying to
accomplish (http://code.google.com/apis/maps/documentation/javascript/
services.html#Geocoding)

The problem with this code is that the map is drawn with a pre-defined
location set before you enter in the zip code. I tried for a few hours
to mix and match the code with the hello world example, however when
messing around, the map doesn't render on the second page.

Does anybody have any suggestions for how to go about geocoding the
zip code and getting the latitude and longitude to create a new map?

Pedro Arango

unread,
May 23, 2011, 11:43:26 AM5/23/11
to google-map...@googlegroups.com
I don't have an answer for you. However I would suggest that you append your complete code as you have put it together thus far. At first joining this forum one is given a compelling reasons to do just that; among them is that as it turns out bugs tend to buzz in a different area of code than we think they are. Hopefully this will get someone to answer your question and I can learn from it too -I'm somehow in the same boat you are. Good luck.   


--
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.


geoco...@gmail.com

unread,
May 23, 2011, 1:14:41 PM5/23/11
to Google Maps JavaScript API v3
Does this example help:
http://www.geocodezip.com/v3_FusionTables_layer-zoom-change-houstonC.html

It is a fusionTablesLayer based map, but if you type your zip code in
the box, it should center the map on the location returned by the
geocoder.

-- Larry
Reply all
Reply to author
Forward
0 new messages