google flash maps, more marker headroom

A quick note on google flash maps. Somewhere in the vicinity of a few thousand markers, initialization time starts to slow down perceptibly; this is not unexpected mind you.. In the maps application I was working on, a  minority of pages passed that mark – enough to look into options, but not enough to rethink “the metaphor”. It turns out getting more headroom in flash maps is really easy. The first thing to do is to create a custom marker to replace the google pin (a movie clip asset will do) using the MarkerOptions icon property. Now the important move – cache the clip as a bitmap (marker_icon.cacheAsBitmap = true;), and pass it into the overlay as the icon. Finally make sure shadow rendering is off (MarkerOptions hasShadow property).

Caching a custom marker as a bitmap and disabling shadow isn’t going solve all your issues if you’re looking to put too many more markers in the map, but it can at least triple the marker threshold before the map becomes unusable, which if you’re dealing with a few wild fringe cases can come in handy..

One Response to “google flash maps, more marker headroom”

  1. Russ Cobb says:

    Hey Ben,

    Just perusing your webstie before sending you an email about tonight. I’ve been struggling with the Google Maps API for a while now, mostly because I’m not a real programmer. But one awesome example of the API with Flash is the Tufts University maps site. Check it out.

    http://campusmaps.tufts.edu/medford/

    RC

Leave a Reply