• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

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

Community Beginner ,
Feb 12, 2011 Feb 12, 2011

Copy link to clipboard

Copied

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?

TOPICS
Development

Views

3.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 15, 2011 Feb 15, 2011

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 06, 2011 Sep 06, 2011

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 19, 2014 Jan 19, 2014

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 20, 2014 Jan 20, 2014

Copy link to clipboard

Copied

There is YCanvas, which also has support for Stage3D/Starling too:

https://github.com/jozefchutka/YCanvas

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 20, 2014 Jan 20, 2014

Copy link to clipboard

Copied

YCanvas looks interesting - but it was too late for me.

I ended up developing the whole thing for offline map handling.  It's been released as a desktop (Windows/OSX) version, Android, and iOS - it's in both the Apple App Store and Google Play.  It's called "ActiveCaptain Companion".  There's a lot more being done with it.  It's basically a navigation system for boats that use our huge social navigation databases.  In this first version, when you're approaching an on-the-water hazard, the app speaks to you to warn you.  It's the first use of voice on boats for warnings and directions like this.  There have been about 25,000 installs in the first 8 weeks.  I'm expecting many more as the next set of functionality is added - there have been previous few bugs in this roll out version.

The apps are free on all platforms.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 24, 2014 Jan 24, 2014

Copy link to clipboard

Copied

@Jeffrey Adams Thanks for the pointer! YCanvas looks really interesting! I will check it out and report back how I get on!

@JeffActive, what platform did you end up using for the Maps? I'm downloading ActiveCaptain Companion now

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 24, 2014 Jan 24, 2014

Copy link to clipboard

Copied

LATEST

I wrote the whole thing myself from scratch.  Doing that allowed me to add some efficiencies that none of the other libraries have although I still haven't been able to figure out the math around doing pinch zoom correctly - that's harder than it seems and I just put it off until I have time to figure it out.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines