Using google map to add your address for your profile
I've got a site where people can add their profile and on that page I ask them their address but I would like them to be able to use the google maps search that you find at http://maps.google.com/ to enter their address.
To give you a better understanding its for a charity group so when the charity group wants to have a event they want to enter they address of the event and then when users come on the event page they want to see the开发者_如何学JAVA google map of the location.
So I want to make sure that when the charity add its event location and save it that when the user come to see the event map that google can understand the address that was entered by the charity. I can of want to have them (charity) to validate the address with google maps before they save it and this way they will be sure that the user will see it properly.
I'm using coldfusion cfmap to show the map and has you can see the var address_saved_by_charity will be populated by what the charity entered:
<cfmap name="eventLocation" centeraddress="[address_saved_by_charity]" zoomlevel="13" markerwindowContent="" width="600" overview="true" />
Why would someone type their address in google maps if they can just put it into your form? Do you need additional data from the Geolocation? If so, I can see how this is useful but you could always get the address from your own form fields and do a valid URL to call the api.
In any case you can look at Geocoding and the google maps api. Geocoding lets you get a position using "123 abc street city state" etc.
Hope that helps
Are you trying to get them to enter their current location or their home address? There are a lot of mobile users these days and their current location is not equal to their address. You can achieve either. Some things to look at are javascripts geolocation API and google maps v3 API. I recently have been working with these. Here are a few links to get you started:
http://blog.bobcravens.com/2010/10/trip-recorder-using-javascripts-geolocation-api-and-google-maps/
http://blog.bobcravens.com/2010/06/a-google-maps-version-3-jquery-plugin/
Hope this helps.
Bob
精彩评论