Skip to main content

A Mapping Christmas Present

Posted by joshy on December 22, 2006 at 10:32 AM PST

You may get several Christmas presents this year so I'd like to give you all mine first. Best to be early than late and forgotten. :) You can scroll down to the screenshot and link if you want, but if you prefer some delightful Christmas suspense begin reading here. You might want to grab some egg nog first. In fact, adding a splash of rum might help too. We've got a lot to go through.

As you may know from reading my previous blogs we have been working to move the mapping component from our Aerith demo into the new SwingX-WS project. Our goal has been to make mapping easy; so easy that you can drag and drop a component into your Swing app and have something that works with no extra configuration. Sadly.. reality often diverges from our wishes.

Our Christmas Wishes

The JXMapViewer, our new mapping component, is still to hard to use. You still have to build too much of your own code and configuration to get it to run. For many applications you just need a map of the world. Right now, when you create a new map component, you get nothing at all. Nada. Zip. Zilch. Nil! Surely we can do something useful by default!

We need a stable data source. The WMS server from my previous examples has been up and down a lot, so we could never guarantee that it would be there when you need it. I've had some trouble finding a reliable server that would give us good performance. Something stable enough that we would feel comfortable setting that server as the default. That's asking a lot.

It would also be nice to have a prefab application or applet with no Java coding required. One of the great strengths of Google's AJAX offerings is that you merely need to paste a snippet of HTML and Javascript into your webpage to get started. We really need to be that easy!

Three Christmas Presents

So for Christmas we wanted to solve all three of these problems. They aren't perfect yet but you can see where we are going and maybe even help out.

JXMapKit. We've recently added the JXMapKit class. It's a composite component that bundles up a JXMapViewer class with common things you are likely to want such as zoom buttons, a zoom slider, and a mini map. It also pre-configures the map component to use a known stable map server. Which brings us to..

maps.swinglabs.org. We need a stable map server. Nothing I've found so far fits the bill, so we thought: why not make our own! For serving up satellite data it's actually quite easy. We took one of NASA's large Blue Marble images and chopped it up into little 256 pixel square tiles. Currently the server is set to maps.joshy.net, but it will be renamed to swinglabs.org soon. We are using a relatively low resolution bitmap right now (a mere 5600x2700 pixels) but we will upgrade to higher rez soon.

Of course our own server can only deliver so much bandwidth and we don't have the disk space for a full set of ground level satellite photographs. That's why we've been talking to some engineers at NASA. They are very interested in working with us and sometime soon we hope to have direct access to the same map servers that power NASA's super-awesome 3D WorldWind client.

JXMapViewerApplet: The only thing better than writing no Java code is not having to compile it either. We have put together an applet that embeds the JXMapViewer right into your webpage without needing to write anything at all. You will be able to drop an APPLET tag into your webpage, hit reload, and have maps immediately available.

So here it is. Our first mapping applet from Swing Labs.

Merry Christmas!

Run the JXMapViewerApplet
requires Java 1.5

Screenshot of the JXMapViewerApplet

A word of warning: This applet is not optimized in the slightest and the JXMapKit itself still has many bugs. This means it takes longer to download than it should (much longer because I haven't stripped the jars yet) and there are several problems with repainting and keeping the map views in sync.

New features coming next year:

We've got more plans for the JXMapViewer in 2007 and we need your help. Here are just a couple of the things we want to work on in the new year

Applet features. While it's not currently working, we plan to let you add waypoints and configure the applet using PARAM tags or Javascript. No Java coding or compilation required. We'd like to hear from you what kinds of things you'd like to do and what sort of API would help.

Get rid of the jar signing. If at all possible we will make the applet load from the same host as the tile server so the applet won't need to be signed. You won't need to host the jars any more. Just link to our jars and go

Performance, performance, jingle bells, and performance: Stripping the jars will help with loading time but the real improvements will come from completely rewriting the image loading / threading / caching routines.

New data sets NASA has a variety of map sets we could use. What would be most useful to you?

New features that you want!. Ultimately we write code that you want to use. What cool things would you like to do with maps?

Happy Holidays

That's it for me for 2006. I'm having my entire family in town for Christmas and then three days later getting married. It's going to be a busy and fun week. Have a Merry Christmas and a Happy New Year everyone. See you soon!

Josh and Jen in front of their Christmas Tree

Related Topics >>