Geocoding tools are not language-specific, but knowledge of JavaScript and XML are important to the layout of the mapping application. Your Common Gateway Interface (CGI) applications -- written in Java, JSP, PHP or any i5 CGI software development tools -- can use these external application programming interfaces (APIs) to make your company look good.
Mapping services, such as MapQuest and Google Maps, provide APIs or programming tools to integrate your websites with theirs, often using Web techniques such as Asynchronous JavaScript and XML (Ajax) to create the link. These tools can give interactive capabilities to your Web application -- it's like using a software program installed directly on your local computer. Because the Web browser is adept at showing formatted output using Cascading Style Sheets and HTML to give you the results, Ajax can greatly simplify your Web software packages.
MapQuest, Google and
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts including news, tips, and advice to help you do your job more efficiently and effectively. Stay informed on the hottest topics and biggest challenges faced by IT professionals working with iSeries products and services.
Example: Google pins
Click to enlarge.
Example: MapQuest
Click to enlarge.
Both online API choices offer geocoding, which is the ability to turn an address into a specific map location. This is very important, since asking your customers for their latitude and longitude could prove difficult.
Let's outline this application so you can get a better idea of what it has to offer. For example, you have a customer who's looking for your closest location to him. First, you have to geocode all addresses that are going to be displayed on the map (as described earlier). Second, you need to calculate the distance between your address and the customer's address, either by writing your own routine or using the built-in tools.
Note that this form of calculation uses a straight line between the two points. If you need additional instruction, the formulas and tools are very well documented on the Web. Remember, this isn't the exact mileage. In areas with many one-way roads, customers could be located within a few hundred yards but may still need to travel farther than that to get to you. Use "about" when describing distance to customers -- as in, "The store is about five miles from your location."
Once this is laid out (and your customer service personnel have been prepped), you can also sort the output for the customer by those calculated miles. Once that's complete, as a finale, you can have your representative or customers (over the Web!) click the location (the pin on the map) and see directions appear in the same window or in a new one.
Online geocoding applications contain a wealth of other features, such as the ability to show satellite imagery, which can give customers a different view of the area they are trying to navigate. In my company's case, our central call center is using geocoding to accurately describe areas that the representatives may not be familiar with. You can limit the satellite display within your application using the setup tools.
ABOUT THE AUTHOR: Andrew Borts is webmaster at United Auto Insurance Group in North Miami, Fla. He is a frequent speaker at Common and is past president of The Southern National Users Group, an iSeries-AS/400 user group based in Deerfield Beach, Fla.
Did you find this helpful? Write to the editor about your IBM i concerns at Editor@Search400.com. This was first published in February 2009