Friday, February 9th, 2007

GPlotter 0.9: Prototype and Google Maps v2 update

Category: JavaScript, Library, Mapping

Brennan Stehling has updated his GPlotter project “to make use of the revised Google Maps API. I also completely restructured the Javascript to a much more object oriented coding style. I am using the latest release of Prototype, which recently moved to a new location as well as posted a great deal of new documentation. I am using Prototype for the object inheritance and AJAX functionality.”

GPlotter Example


  1. var plotter = new GPlotter();
  2. plotter.setColor(plotter.BLUE);
  3. plotter.setIconUrl("");
  4. plotter.plot("map", "labels", "milwaukee.xml?version=0.9.0");

Extending GPlotter


  1. var MyMapper = Class.create();
  2. Object.extend(MyMapper.prototype, GPlotter.prototype);
  3. var mapper = new MyMapper();
  4. mapper.plot("map", "labels", "milwaukee.xml");


Posted by Dion Almaer at 12:07 am

3.2 rating from 32 votes


Comments feed TrackBack URI

Seems a shame to have a dependency to a (relatively) big library like Prototype to do this. Good stuff though.

Comment by Jerome — February 9, 2007

I’ve looked at the code and tinkered with it for a few minutes. I don’t believe it would be much work at all to use a minimal configuration of Mootools for underlying class support. That could reduce its library dependency to 14k.

Comment by Jeffrey — February 9, 2007

Prototype does not provide object orientedness or object inheritance, it provides class inheritance emulation. JavaScript is already object-oriented, it is just that most people learned and are more familiar with class-based object oriented programming rather than prototypical object oriented programming. I believe prototypical is actually purer “object-oriented”.

Comment by Ajax 2.0 Developer — February 9, 2007

Jeffrey, Prototype is 15k when gzipped. Size is a non-issue. Please stop spreading this FUD.

Comment by Anonymous — February 9, 2007

We used this same approach last year only used explicit XML data islands and didn’t require any inline javascript. We think it is much cleaner. See for a sample site. Today we have our own map tiles but will have integrated OpenLayers and will soon relaunch so you can do this with Google maps, Virtual Earth, Yahoo Maps or our own tiles. We think our approach makes mashups as easy as HTML programming (no javascript required).

Comment by Jon Scarbrough — February 10, 2007

i think Prototype is not as much object oriented as Jquery.
but, i personally like both of them for different things.
Gplotter is gr8 though it needs a few improvements and developements

Comment by Google Logs — February 11, 2007

Is it possible to use GPlotter with the jquery framework, instead of prototype? I would like to see it work if possible

Comment by Jimmy — October 25, 2007

Leave a comment

You must be logged in to post a comment.