GPlotter is a Javascript object which provides a simple interface to plot markers onto Google Maps using a simple XML file. The interface allows the user to write a few of lines of Javascript to provide this cross-browser functionality. It has been tested and works with MSIE (6 & 7), Firefox and Safari. [ See Documentation ]
Example: Locations in Milwaukee, WI, USA
Map data ©2007 Tele Atlas - Terms of Use | 1. The Gig 1132 E. Wright Street Milwaukee, WI 53212 414 562-0219 2. Trocadero 1758 N Water Street Milwaukee, WI 53202 414 272-2050 3. County Clare 1230 N Astor Street Milwaukee, WI 53202 414 272-5273 |
Usage
Using the GPlotter requires the Google Maps API and Prototype (1.5.0), a cross-browser Javascript library providing AJAX and object inheritance functionality. Simply reference them as is normally done with Javascript. Then reference GPlotter. This page is a working example and can be used as your starting point.
Extending GPlotter
The Prototype object inheritance model can be used to extend GPlotter with your own custom object. Either add your own custom methods or override the GPlotter behavior. This clean separation will reduce to work to integrate your changes with a future release of GPlotter.
var MyMapper = Class.create();
Object.extend(MyMapper.prototype, GPlotter.prototype);
var mapper = new MyMapper();
mapper.plot("map", "labels", "milwaukee.xml");
Downloads
- GPlotter.js (v0.90)
- milwaukee.xml (sample XML file)
- Prototype Library (website)
Free Map Icons
These free icons are in red, green and blue numbering 1 to 25 each as well as an empty one for each color. Please host these icons on your website, just download Google Maps Icons.zip.
XML Format
The XML format is currently marked as 0.9 and the GPlotter object is designed to support this version and future versions. The root element must be named locations
and include the version attribute. Child elements may change with each new version. As new XML format version are defined new versions of GPlotter will be published. Also, The XML format is also intended to remain neutral to the mapping system while GPlotter will remain specific to Google Maps.
No comments:
Post a Comment