Using the Google Map API, you can provide interactive map plotting using address, zip code, or latitude/longitude coordinates stored in your System i database files. Below are 5 quick steps to get the process working for you:
- First, you must obtain a key from Google. The following link will take you to the main Google Maps API page: https://www.google.com/work/mapsearth/products/mapsapi.html
- Once you have your key, you need to add it to a starting page that will be accessed by a browser. We can provide you with a simple page to use - Sequelmap.htm - that works in con- junction with a SEQUEL-produced xml mapping data file.
Open the sequelmap.htm file with a text editor, and add your key by finding and replacing the key value (key=) in the following line:script src="http://maps.google.com/maps?file=api&v=2& key=ABQIAAAAsI3C5aBzvKJss9rdUsRKGxTYxGDrlepneNQn1cxPU5XcR1g7cRTPLjd7 TEeIayGtNtp6keXX-JR6OA"
(the above is entered on one line)
- Save your sequelmap.htm file, and place it in a location that can be served by your http server. This may or may not be an iSeries machine. If the Google server cannot access this page, the mapping api will not work.
- Run an appropriately designed query to output the required xml data. You must write the xml data to a location that can be accessed by the server that serves the sequelmap.htm file. You can eliminate the need to worry about browser security settings by placing the sequelmap.htm and the xml data on the same server, but this is not required.
- Serve the sequelmap.htm file to a browser, passing the location and name of the associated xml data. The example URL below shows an xml file (mapdata.xml) associated with the sam- ple sequelmap.htm file.
The How-To article, SEQUEL with Google Mapping, has a more complete explanation of the Google Mapping process, and how the xml data should be formatted.