Service Objects, Inc.

Tech Spotlight from the Service Objects Development Team

 
How to make a Google Map Mashup with A Contact Validation Web Service
Sample Code and Instructions
 

One of the things that makes Web services so simple (and fun) to use is how easily they can integrate into 3rd party platforms, APIs, and frameworks. Google Maps, for example, makes an excellent fit for our Address Validation Plus Web service, as well as any of our products that return a latitude and longitude. Just for fun, I went ahead and wrote a quick sample that does just that.

To download sample code, visit http://www.serviceobjects.com/products/address/address-validation-plus-us/google-maps-mashup.

By modifying our existing PHP sample code, I created a function that uses embedded PHP to generate the necessary javascript for placing a Google Map onto a page. The server-side code, once it receives a response from our service, sends the latitude/longitude values to a function that constructs the script body, and instantiates the GMap, GPoints and Markers with the values of server-side PHP variables.

To use this sample, extract the PHP file to your web server, and navigate to it in your browser. You'll see a form with address fields, a license key field, and a Google Maps API Key field. The sample is coded to use our trial servers, so to use it as-is, you will need to obtain a trial key. If you're a customer, you can change the service URL in the code to point to "ws.serviceobjects.com" and use your production key instead.

To obtain a Google Maps API Key, go to this URL:
http://code.google.com/apis/maps/signup.html

This is just a very simple example. It could be extended to use Google Maps' directions API to give you shortest-distance paths between two addresses. Or you could create overlays showing block and tract codes. There are some fantastic possibilities out there for visualizing and displaying our data, and Google Maps is just one of those possibilities. Try it out today and let us know what you think!

 
Privacy Note: Our email is never unsolicited. You provided an email address of: *|EMAIL|* when you evaluated our software. To unsubscribe send an email to: communications@serviceobjects.com or click here.
Previous Newsletters
Privacy Policy
Copyright ©2011 Service Objects, Inc.
133 East de la Guerra St, Suite 10, Santa Barbara, CA 93101, USA
serviceobjects.com
sales@serviceobjects.com
Tel. Toll Free US 1.800.694.6269
Tel. Local 1.805.963.1700
Fax 1.805.963.9179