scrollie edited this page Sep 13, 2010 · 5 revisions
Clone this wiki locally


Scribbling on my iPhone

Written by tschaub, December 8th, 2008 at 4:05 pm

So, I got my very own iPhone last week. I felt just like those happy people on the adds – even though mine was just the simulator that comes with the SDK. Whit gave me a tour of the cool work he had done with iOL.js to date, and we paired a bit on getting up a little drawing demo.

The library & examples are now structured a bit more like the OpenLayers stuff – with the hopes of making it comfortable to those coming from that direction. I did a bit of work getting Whit’s sketch handlers working so you can now draw points, lines, and polygons with a few touches. The draw example uses the iui lib to provide simple menu access to the draw controls. I hadn’t checked out iui yet, but can see now how it could be used to compose more complex apps while preserving the native interface experience.

Based on what Chris Schmidt started with client-side storage in OpenLayers, I put together an HTML5 protocol that works with vector layers to provide access to structured storage as described in the HTML 5 working draft. In the drawing example, this protocol is coupled with a “save” strategy configured to auto-save every time a new feature is added or modified. So, you scribble on your phone, turn it off, and the features are still there when you turn it back on.

The demo is obviously a bit rough and has little purpose on its own. The work, however, did demonstrate to me the very real potential of using the iPhone as a data collection and storage device – with the ability to work between on and offline modes, syncing with a remote service when appropriate. Check out the source and let us know if you’re interested in contributing – we would love to see a development community organize around this.