MapSnap: An Apollo Example Application

MapSnap was one of the first Apollo applications I wrote which incorporates HTML. It lets you look up addresses on a Yahoo map, and save the maps as a PNGs to your desktop. It’s a very simple application, but I think it makes for an excellent example.

MapSnap demonstrates the following:

  • The general structure of an Apollo application.
  • The use of system chrome.
  • Stopping a window from resizing.
  • Loading local HTML content.
  • Script bridging (calling into JavaScript from ActionScript).
  • Encoding a PNG.
  • Including an icon in your Apollo application.
  • Using a native file browser (the technique I use in MapSnap is a hack, but it will get you through until we officially add this functionality to Apollo).

If you just want to run the app, all you need is the Apollo runtime, and the MapSnap AIR file. If you want to see the source code, here is the Flex Builder project. There’s a lib directory in the project with corelib.swc in it which you need to link in to your project in order to get the PNG encoding support.

12 Responses to MapSnap: An Apollo Example Application

  1. Thanks Christian!Is there any chance to release the hot app with the address book cards and the yahoo maps?Take care.

  2. Erki Esken says:

    I wonder why you didn’t enable View Source feature of Apollo apps as Flex Builder project setting like you did with Flex apps. In this early development phase it would be cool just download single .air file, test the app and view source as well.

  3. We’ll probably enable view source at some point. And yes — I will be release Maptacular at some point. And tons of other apps. I just need to clean them up a bit.Christian

  4. Mark Muday says:

    Is it safe to assume that, as this is an alpha release, that performance will be considerably snappier come 1.0 time?There is still a hint of sluggishness in the sample apps I have played with, most notably, Fresh… The app and the interaction seems simple enough that there shouldn’t be any perceptible lag when clicking from post to post (even after it has been cached).I was hoping that flash 9/tamarin would eliminate the lags. That would make me a True Believer, rather than a mere advocate of all things Flash.

  5. P Buchanan says:

    ChristianGreat demo – thanks for sharing. Just an FYI – after running it on my machine for a few minutes it has already sucked up a half-gig of ram. I zoomed in to the parks area of SF and drug the screen around, then entered in my home address. Bam – 500 mb.Thanks!-Pat

  6. Aaron Conran says:

    Great work. I’m excited to see the possibilities of intermixing all of the web technologies with desktop app power.Mark:The Fresh app is actually a DHTML/JavaScript application running on the Ext framework (formerly yui-ext). As an active user of the Ext framework and beginning blogging about Ext and ColdFusion, Apollo is a very exciting project. This demo shows my boss and my team that right out of the box, Apollo is able to run sample application from the Ext framework. This is huge if we decide to create an Apollo application from existing source.Unfortunately, I think that Adobe could have provided a little more attribution to Jack Slocum . Here is a link to the original app which is running under Apollo.

  7. Matt says:

    When I click Snap I get this error:Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error.at flash.filesystem::File$/flash.filesystem:File::getFile()[C:\Documents and Settings\acrorel\Local Settings\Temp\aslibc-26332\File.as:1535]at flash.filesystem::File$/get desktopDirectory()[C:\Documents and Settings\acrorel\Local Settings\Temp\aslibc-26332\File.as:711]at MapSnap/::takeSnapshot()at MapSnap/___Button2_click()any ideas?matt

  8. Gary Mangum says:

    Has anyone tried building an AIR project with the YahooMap component? I am using the beta release of AIR and am having trouble getting it to work.I get the following error:1046: Type was not found or was not a compile-time constant: YahooMap.It doesn’t seem to be bringing in the yahoo libraries or something.

  9. Peter says:

    There is still a hint of sluggishness in the sample apps I have played with, most notably, Fresh… The app and the interaction seems simple enough that there shouldn’t be any perceptible lag when clicking from post to post (even after it has been cached).

  10. Daniel says:

    “Using a native file browser (the technique I use in MapSnap is a hack, but it will get you through until we officially add this functionality to Apollo).” So did they add it. Any new information about it? Thanks.

  11. The newest version of the app (available on labs.adobe.com) uses the real file browsing APIs. The app is now called MapCache. Check it out.Christian

  12. sharp aquos says:

    Has anyone tried building an AIR project with the YahooMap component? I am using the beta release of AIR and am having trouble getting it to work.