Monthly Archive for February, 2009

Spicing up Google Maps in Flash

]This isn’t news to everyone, but it’s worth pointing out the fun things one can do with maps using the ActionScript ColorMatrixFilter. Tired of the boring old yellow and orange Google map in the Flash API (or any other map in Flash/Flex)? Lay down a ColorMatrixFilter on that sucker!

The ColorMatrixFilter, if it needs to be pointed out, essentially allows you to mix up the red, green, blue, and alpha channels of vector or raster graphics to produce exciting new colors. Adobe has a nice little article explaining it, along with an interactive demo.

Here’s a little example of simple effects I threw together for Google Maps. Click the links at the bottom for different looks.

Get Adobe Flash player

I poked around the Google Maps Flash API to find exactly where to apply the filter. If you apply it directly to the Map instance, you’ll color everything, including the Google logo and whatever else floats on top of the map. One level deeper is better, but will still color makers and info windows. A second level deeper is the spot. It’s basically like this, where map is the Map instance:

var a:Sprite = map.getChildAt(1) as Sprite;
var b:Sprite = a.getChildAt(0) as Sprite;
b.filters = [new ColorMatrixFilter([ /* color matrix values */ ])];

In the example above, “Winter” takes the red and green input channels and distributes them equally across all channels, but the blue input remains blue on output. The result is an desaturated, icy-looking blue. “Inverted Grayscale” turns everything to grayscale, but additionally sets the map’s blendMode property to “subtract” and sets it against a white background. That inverts the grayscale image for a somewhat stylish effect.

Now, let’s face it: this is a quick and easy but very limited method for “customizing” a map. (And to be honest, I’m not sure how kosher it is according to the terms of service.) It can make a map look cool, but applying the effect to pre-made tiles means that you’re altering the colors of all features on the map. You can’t keep the official blue and red of interstate highway shields, for example.

So keep this little trick in mind, but be more excited about actual customization (and open data) with CloudMade.

Indiemapper

Dear Map-Enthusiast,

We are very pleased to announce the launch of indiemapper.com. Indiemapper is a project that is very near and dear to our hearts. When we were starting as a company or even before that at the University of Wisconsin, we constantly talking about the tools available to us as cartographers. Talking might be putting it lightly… we were complaining.

The same things were coming up time and time again. Why is it so hard to make a simple map from digital data? Why did we need to keep PC’s around when all of our design work was done on Macs? Why was all the current software so expensive when we were only using 10% of its total functionality?

At the same time, we were building some great online tools built for cartography. Ben was building TypeBrewer to help map-makers understand and make better choices with typography. Mark had built ColorBrewer a few years earlier when he was back at Penn State. Dave was working on bringing usable UI controls to temporal and geographic visualization in BallotBank. These programs were built on expert content, usability and accessibility.  Why weren’t web-based tools like this available within a the map-making environment?

Flash forward to the spring of 2008. Indiemapper began as a proof-of-concept built by Andy and Zach Johnson during their free time. They wanted to see just how much of the cartographic capabilities of GIS could be moved online using Flash. As it turns out, quite a lot. Originally, we thought that this would be a great code repository from which we could draw ideas and code to build into maps we were making for clients. Then it all came together. Indiemapper was so close! Andy’s original work proved it could be done. We could finally build the application that we ourselves had been wanting for all these years!

Indiemapper is still in development and there’s a lot we’re still learning about the final product. We’re re-coding that original prototype from the ground up to make it robust enough for professional cartographers in a production environment. We’ve redesigned the UI and built in expert choices (colors from ColorBrewer, type from TypeBrewer, data classification, etc) to make it easy for novice map-makers to produce great looking maps quickly.

We know that there are lots of people like us who are frustrated by the current available tools because of their price or their functionality. We’re confident indiemapper is for you and will find a place in your mapping workflow.

Looking forward to making maps with you,

Axis Maps LLC