GeoPortal Template and Projects Moved to Google Code
jQuery UI 1.8 was released last week, and I took that opportunity to give the GeoPortal project a kick in the nethers. To paraphrase Jeff Atwood‘s sentiment, the worst code I’ve ever seen is the code I wrote six months ago, and I’ve found that to be a true statement at any given point in time. Six months from now the code I wrote this morning will be the worst I’ve ever seen. This project’s code base was getting old and cruft had built up over numerous iterations. It was time for a purge.
I wanted to do a couple of other things with a new version as well.
- I wanted to host the project somewhere and allow contributors in, and as a part of that,
- I wanted to make a generic template product rather than dumping an active Mecklenburg County website out there. We released that as open source code, but it wasn't really an open source project, as I can't really let people contribute to the codebase of an active application. We'll eventually have full sites like that for download as demonstrations.
- I also wanted to make a generic template so it would be easier for people to digest the code, including my coworkers. Our budget situation is three notches short of awful, and the easier I can make it for my peers to hop on board our FOSS stack the better.*
So I created a basic GeoPortal template and moved it to Google Code, along with our web service framework and metadata navigator projects (links on the Projects page). Among the new stuff:
- Vastly improved and streamlined the code.
- All styling is done via jQuery UI themes. All you have to do is change the CSS link to one of the other themes on Google's CDN and everything, from result tables to font colors to UI components, will be changed.
- It now uses the excellent jQuery UI Layout to handle page resizing/layout.
- Switched from WGS84 to web mercator, so it'll be easier to consume Google Maps/Bing/etc. resources.
- Created a LayerSwitcher2 OpenLayers component, so you can stick the layer switcher anywhere you want without the hard-coded styling (basically the LayerSwitcher component with the styling/positioning elements ripped out or tweaked).
- It uses services from the web service framework for autocomplete and data results, retaining a few examples of data query and JSONP processing to serve as examples.
- Built a map toolbar and added some controls, which was inspired/stolen from this great post from Linfiniti. That article was written pre-jQuery UI 1.8, so it's quite a bit easier now to make the buttonset, but the code and ideas are basically the same. It's linked into the UI theme, so it will also adapt to UI theme changes automatically.