3D Perspective in the Maps API for Flash!
July 31st, 2009 | Published in Google Maps
2-D maps are great, but sometimes it's cool to gaze into the distance. Today we're happy to announce support for perspective in the Maps API for Flash. We've taken the regular API, added pitch and yaw, borrowed the look-around control from Google Earth, and thrown in some nifty camera trajectory support. The opportunity to see the world from a chosen point of view is now in the hands of a user!
Here's a perspective map in action. Sit back and watch or dive in and drag the view. Try holding down the zoom plus (+) or minus (-) buttons to see the new smooth continuous zoom.
Play with demos and the possibilities emerge. Shadows stretch out as the land tilts back. Foreground detail blends with background context. Movement through the world becomes first-person in nature and distant features can rapidly be dragged to the fore. On a regular map a cluster of markers might only confuse. Spin a perspective map and their pattern becomes clear as nearer markers pass in front of their more remote partners.
A key strength of Flash is its ubiquitous nature and we've taken care to develop an API that preserves this advantage. While supporting the latest, greatest Flash players, the API requires only Flash 9. Build a single target and API runtime code matches implementation library to player version. Flash 10 users gain the benefits of the native 3-D graphics support--rendering speed and accuracy--but Flash 9 users won't be left out.
So how do you create a 3-D map? If you've not used the Maps API for Flash before here we've got lots of documentation to help you get up and running. For those who've used the API and have an existing map to hand, three quick changes should suffice:
- Replace Map with Map3D
- Turn on perspective:
Map3D.viewMode = View.VIEWMODE_PERSPECTIVE;
- Replace the old position and zoom controls with the new navigation control:
addControl(NavigationControl);
While this new functionality is aimed at Flash developers, we also have the Earth plugin and API for those of you working with JavaScript and the JS-based Maps API. For developers using the Maps API for Flash, today's release is just an extension of the existing Flash API; where it makes sense, we have borrowed some learnings from the Earth API (and will continue to do so). From a user's viewpoint, if you've used the Earth plugin or Google Earth, the controls will all be familiar. We've kept the same basic key mappings. Add SHIFT to tilt the map, or CTRL to tilt your view and you're ready to go. More features are hidden just under the surface. Animate a flight from A to B, or apply perspective scaling to your markers. See the new API reference documentation for details.
As always, for those of us working on APIs, the most rewarding aspect is of seeing what developers do with it. Here's what some of our trusted testers have done to date:
UK Weather Tour | ArcGIS Services | PaperVision3D Scene |
Ian Watkins | Nianwei Liu | Satoshi Ueyama |
Eiffel Tower KMZ | 3D Driving Simulator | Weather Radar GroundOverlay |
Masashi K | Katsuomi.K | Andrew Trice |
Check out some more demos, have a play, make some maps, and let us know what you think!