Posted by: edsyrett | 30 August 2008

Update on Google Maps

Now I’ve created an ActionScript component that wraps the Google Maps API.  It only took about a days work, but the end result is that I’ve got a component that takes a list of addresses plus their lattitude and longitude, and show the following information:

  • A map showing all the points
  • A list of the addresses
  • A list of directions through through each of the locations
  • A “trip list” that shows the estimated departure and arrival times at each stop, including a Dwell Time, i.e. the length of time spent at each stop.

On each list you can click on an item and the map will centre on the location for the item.  For the directions, this means centering on the actual point the direction refers to, i.e. if it says “turn left at the roundabout” the map is centred on the roundabout…:-D

But, as usual, there were a few holes to fall into….

The Dreaded DEBUG Overlay

I saw quite a few posts from people moaning about not being able to get rid of the dirty great “DEBUG” on the map.  Imagine you’re doing a demo of mapping to somebody – you definitely don’t want pesky “DEBUG” all over your map do you?

We fiddled about for a while before finally figuring it out.  You can plug in either the domain name of your webserver, or if you’re running from a local webserver, the IP address of your machine, including the port if it’s not 80.  So generating a key for “ will get rid of “DEBUG” on your maps.  However, “http://localhost:8080” didn’t.

Effects On Maps

You can’t run an effect on a Google Map control after it has initialised – you’ll get a Security Sandbox Violation.

The reason for this seems to be that the effect will try to get hold of the bitmap for the maps independently of the map component.  As the Google maps site doesn’t have a crossdomain.xml file this is doomed to failure. Sooner or later we’ll have to find a way around this as all our windows appear with an Iris effect and we don’t really want to turn this off just for our map window.  I’ll look at hiding the map while the effect is playing and post back here if I get anywhere…

This problem also applies to printing as it’s pretty much the same scenario.  There’s a feature request here at Google Code to allow printing.

As I mentioned in a previous post, I’ve already had a play with the HTML/Java maps interface, and I think that took me a week to get a list down the left and a map with points on it.  I’ve already achieved over double the amount of functionality in under two days with the Flex API so that should give you some idea of the potential of this API.

Thanks to Google….


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: