One of the hardest things that we have had to tackle when we started to integrate mapping with
GoDo was to get users to tell us where they were.
Not many people know their Latitude and Longitude, so we had to come up with a simple way that they could tell us where they were. We decided to turn the map itself into a form field so that users could just click on their location and it would write down their lat and lon for us.
We whipped up a nice little custom tag to handle it for us, It renders a map and three fields (lat, lon and map zoom) and fills in the fields based on where the user clicks on the map.
The tag hides away all of the javascript required to control the Google Map API
Once the custom tag is in your custom tag path (or imported via CFImport) you just give the control a name and pass in your google map key and you will get a basic map.
<form method="post">
<cf_mapPicker name="home"
mapKey="ABQIA.....ubgGxJcIgaDNQ">
<input type="submit">
</form>
<cfif structKeyExists(form,"fieldnames")>
<cfdump var="#form#">
</cfif>
Click on the map and you now have a location.