Sunday, November 23, 2008

2 More Libraries Released: ProgressBarControl & SnapToRoute

Hi, my name is Björn Brala! In the last 2 years, I've been working on GeoStart, a framework based on the Maps API. In that time the community has been an invaluable source of information and help. While getting help is nice, helping is even nicer - so I've decided to properly release and document the code for two helper libraries into the open-source utility library project.


ProgressbarControl

When loading hundreds of markers into a viewport, you should communicate this to the user, and this class will help you do so. The progress bar is a custom GControl with a few basic commands to start, update and stop the loader. The general idea is that you set the amount of operations the map will plan to do and then once in a while send an update command to the control.

The example below uses the control to show the progress of markers being added and removed from the map. Click the "loadMarkers()" button to start it up:

If that interests you, check out the reference and developer's guide for the ProgressbarControl.


SnapToRoute

In our framework, we wanted to enable administrators to not only create routes, but also plot different POIs along a route - so I created the SnapToRoute class based on one of Marcelo's examples. This class lets you snap a marker to the closest point on a polyline, ensuring that the marker is always somewhere on the line.

There are numerous ways to use this tool. The example below uses the class to let you zoom into segments of a polyline:

If that interests you, check out the reference and developer's guide for SnapToRoute.

Hope everyone likes the little additions, and don't forget to check out the other classes in the utility library!