Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Pick Google Maps location from Google Maps and store this location in database  RSS feed

 
Patrick de Kruijf
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there, I don't know if this is the right forum for my question, but here I am

I've been searching this forum, Google and the Googlemaps API but couldn't find the answer on my question.


Is it possible to write a java program that let's the user pick a location from Google Maps and store that location, as a postcode, in a MySQL database field? That way the users don't need to know the postcode, they can just pick the location from the map.

I only find discussions about displaying a postcode from a database in Google Maps. What I am looking for is the other way around.


Hope you can help me, thanks for your time and effort!

Patrick



 
Karthik Shiraly
Bartender
Posts: 1210
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Geocoder object's geocode() method can translate a LatLng position to a street address. One of the returned address components may contain a a postal code .
However, it doesn't work consistently for all addresses. Works for US addresses, but doesn't work for addresses here in my country. You might want to try it out for countries which your users typically select.
 
paul nisset
Ranch Hand
Posts: 253
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe this might be example you are looking for.

http://code.google.com/apis/maps/documentation/javascript/basics.html#DetectingUserLocation
 
Patrick de Kruijf
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks for your quick replies and sorry my late one. I think you both send me in the right direction, but I think programming this is a bit out of my league. I'm gonna try anyway, I'll keep you informed on my findings.

Thanks again for your time and effort!

Patrick
 
Adones Pitogo
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know this is an old post but I'll just put my answer anyway to help future searchers of this topic. I think this jquery plugin is the answer to this problem but I personally haven't used it (just about to giveit a try after posting this answer) - http://logicify.github.io/jquery-locationpicker-plugin/
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!