Google Map Insert/Update Coordinates  (by Felice Di Stefano)
(ASP, PHP)

This is not a real server behavior but requires the Insert Record or Update Record server behavior already present on the page in order to be applied. It will allow you to catch the user coordinates which will be saved into the database table when the user register or update his profile, accordingly your database must have columns for latitude and longitude, it would be appropriate to define these two columns as float (10,6). As said above you will use this behavior in a registration form which must provide a complete address for the purpose.

Applying

First create the registration or update form then add two empty hidden fields to bind to the latitude and longitude columns in the database if it is an update form bind the relative recordset columns to these, the form must have fields for address, town and country if this was not specified on the behavior dialog. Is recommended to validate fields since a complete address is required to retrieve coordinates. Complete your registration form applying the required server behavior as the Insert Record or Update Record including the hidden fields to be assigned to latitude and longitude columns. Now you can apply this behavior. Select on the page the submit button for the registration (click on it) and open the Google Map Insert Coordinates dialog.

Google Key: Insert the Google Api key, which you can get it here, for the site address you will use this application. The default key in the dialog can be used only on your machine localhost server.
Form: Select the form containing the registration elements.
Defined Country: You may specify a country here in this case there will be no need for a country field in the form and not in the database. This will occur in case there will be only users of a specific country.
Address Field: Assign the field in the form containing the address.
Town Field: Assign the field in the form containing the town.
State/Prov Field: Assign the field in the form containing the state or provence. (this can be ignored)
Country Field: Assign the field in the form containing the country. (this can be ignored only if it was specified a country in the above field)
Latitude Field:: Assign the hidden field in the form used to catch the latitude.
Longitude Field: Assign the hidden field in the form used to catch the longitude.
Use Button: Choose this and insert a value if you want to use a standard form button.
Use Image: Choose this and browse to the image to insert the url source if you want to use an image as button.

Note: The selected button (if you clicked on it) will be replaced with a new one appropriate for the purpose or in any case a button will be created where the cursor is located, in that case you can move the new button where you like and remove the original.


by FELIXONE