Skip to main content
Known Participant
February 13, 2011
Question

Air on iPhone/iPad/Android for mapping (OpenStreetMap, etc)...

  • February 13, 2011
  • 1 reply
  • 3863 views

I've been messing around with putting a basic map application in Air on the iPhone/iPad/Android.  I've written many of these types of things before.  It works fantastically well in Air on the desktop - adding 3D, multiple map sources, markers, etc.  It's simply fantastic.  The experience hasn't been so great on the mobile devices however.

First I tried using ModestMaps.  It's a pretty complete tool and it was quite simple to put something together to display a map.  The performance on the mobile devices was terrible - totally unusable.  After reading and watching everything I could find about improving Air/iPhone performance (great articles and videos out there!) I hacked ModestMaps a bit to add some creative bitmap caching and stuff.  It didn't help at all.

I then decided that perhaps ModestMaps was just too bulky so I wrote a quick tiling app that generates 256 x 256 tiles and just pieces the bitmaps together.  It's super quick since there's no tile loading from Google, OpenStreetMap, etc.  Again though, performance on the mobiles was terrible.  Incredibly bad.  I was very efficient with only keep the number of tiles actually needed in the display.  It tried moving the individual tiles when panning along with addChild'ing them into a single surface and just panning the surface.  Total failure - miserable performance.

So here's what I don't get...

I don't expect the performance to be as good as a native iPhone app.  But how come a javascript/html app provides acceptable performance.  Here are a couple of examples (that even use iPhone/iPad gestures):

http://opentouchmap.org -- a little sluggish but perfectly acceptable

http://khtml.org/osm/v0.79/examples/mobile/index.html -- pretty nice performance

How come the compiled ActionScript-into-iOS-native code runs so much slower than the interpretted javascript?  Is there something that I'm just totally missing that can be done to greatly speed up this bitmap tile manipulation in Air?

Again, everything works stellar on the desktop Air apps.

In a related subject, I thought about going solely to vector map data instead.  This might be good if the vectors could be loaded into the GPU and manipulated with the matrix methods there.  There are lots of native examples on the iPhone with navigation products that do this in 3D with incredible performance.  I couldn't find any way to force things into the GPU/OpenGL/etc.  There are a lot of very trivial Flex/Flash/Air examples of putting a bunch of copies of the exact same 3D sprite onto a stage and having it rotated and matrix-manipulated with the GPU with beautiful results.  But what about something real?  Is it possible to put tiles of vector data onto the stage and have them manipulated as nicely?  There seems to be a size limit to putting vector data into the GPU and it appears pretty small.  Is there any data on how sprites are selected for GPU transfer?

Thanks for any suggestions or ideas.  I'm sure this tile/bitmap manipulation in Air on mobiles is something that would be useful to many developers.  Has anyone done a tiling game with Air for the iPhone that gets good performance?

This topic has been closed for replies.

1 reply

Known Participant
February 15, 2011

No one has any thoughts on this??

I'd certainly like some feedback about why html/javascript of tiled map display is so much faster than Air code...

Thanks.

September 6, 2011

That's exactly what I'm looking for, too. I don't care if it's a raster based solution or vector (would be nice, if we could use vector Illustrator or svg data with something like vector tiling). I need to display interactive maps and don't know how this could be possible with air with good perfomance.

Have you found a solution Jeff?

Inspiring
January 19, 2014

Hey guys,

Did anyone ever get to the bottom of this, I'm just about to startup a  mapping projects, so currently just doing a bit of research.

Cheers