Atul Varma
February 8, 2008
GeoLeap Demo is a simple project I undertook to re-acquaint (or in some cases, acquaint) myself with a number of Web technologies such as Javascript, DOMStorage, CSS, Web Services APIs, and Ajax.
I've always found most mapping applications to be difficult to use due to their inherent complexity. Since I'm moving to the Bay Area, though, I wanted to create a simple, humane interface that I could use to record my journeys around the area and allow myself and others to explore them visually. Additionally, I thought it might be useful to create a foundation upon which a Linguistic Command-Line Interface (LCLI) could be used to operate on geographic selections. This could allow for a very clean, simple interface that is still quite powerful and flexible.
The interface is quite simple. The user can click on a marker in the map to select it, at which point it becomes their current selection; the marker changes from gray to red to indicate it as such, and information about it is displayed in the right sidebar.
The user can also GeoLeap by holding down the shift key and use it as a quasimode to incrementally search to a new location. Any text in a location that matches the search text is then automatically highlighted as the search proceeds, and the user can release the shift key to make the active location their new selection. For example, GeoLeaping to "Mount", should take you to the Mozilla office in Mountain View, CA; GeoLeaping to "Toro" should take you to the Mozilla office in Toronto; and GeoLeaping to "beer" should take you to the Hopleaf bar in Chicago.
This demo is pretty bare-bones and can be improved in a number of ways. Examples that come to mind include:
I tried to separate all details of the visual layout out into a CSS file (map.css). All Javascript code is in map.js; it's generally object-oriented in design and uses the Google Maps API. A simple XML file, locationInfo.xml, contains information about locations, and missing geocoding information for any of these locations is dynamically fetched using Google's geocoding API and stored in the end-user's browser using DOMStorage.
At present, the quasimodal GeoLeap functionality has only been tested on Firefox 2 and Firefox 3. It's known to not work on Safari because that browser doesn't send Javascript events when the shift key is pressed and released.