Using SVG to Create Interactive Maps on the Apple iPhone

So you can’t have Silverlight, Java or Flash to develop interactive mapping on the iPhone and have to “resort” to using JavaScript. Well maybe not, could SVG be the way forward to creating mapping websites on the iPhone?  My 2G iPhone seems to support SVG fairly well, but many SVG sites aren’t optimized for the iPhone.  Take ESRI’s abandoned (?) SVG Viewer:

ESRIs ArcWeb SVG Viewer

ESRI's ArcWeb SVG Viewer

It loads and you can turn on and off the “widgets” with ease.  But navigating it was impossible.  I know zero about developing with SVG so I suppose someone else will have to comment on if it is possible to create iPhone compatible navigation for SVG apps.  Heck if ESRI were to make a ArcGIS Server SVG API compatible for the iPhone, every ArcGIS Server implementation would be viewable on the iPhone.

This entry was posted in GIS and tagged , , , , , , , , . Bookmark the permalink. Both comments and trackbacks are currently closed.

13 Comments

  1. Posted September 18, 2008 at 4:08 pm | Permalink

    It appears that one can use OpenLayers (http://www.openlayers.org) to build mapping applications on the iPhone. The vector renderer in OpenLayers 2.7 works on the iPhone. There is no iPhone control defaults in OpenLayers so one would have to translate the gesture events into mouse events or create gesture event handlers for OpenLayers to get things working properly.

    See the below list discussions with regards to SVG, iPhone, and OpenLayers

    http://www.nabble.com/OpenLayers-in-Safari-on-iPhone-td18552738.html#a18980145

    http://www.nabble.com/Canvas-for-Safari-…instead-of-SVG-and-iphone–td19289750.html#a19289750

  2. Posted September 18, 2008 at 5:01 pm | Permalink

    There are lots of SVG mapping interfaces in use now. I developed the ones at http://www.lrcwe-data.com/AquaMap.svg and http://www.lrcwe-data.com/UDFCD.svg which uses PostGIS for the vector data (SVG) and TileCache for the Raster images. Full details on development and examples for this type of interface are at http://carto.net

    There were lots of examples of SVG GIS applicatons at the SVG Open converence. The proceedings are at http://www.svgopen.org/2008/index.php?section=conference_schedule The current issue is these are designed for desktop screens. Moving to the iPhone will mean recoding the navigation controls a bit and rethinking the use of screen real-estate. For example the developer is looking at using the mouse wheel for zoom but how is that done on a iPhone? An overview map is probably not possible on a mobile screen. I don’t have an iPhone (or a Mac) so I am not sure how to test them yet but I am interested in porting this to a mobile device.

  3. Posted September 18, 2008 at 6:31 pm | Permalink
  4. Posted September 19, 2008 at 1:10 am | Permalink

    MapViewSVG is an extension to create SVG maps. At tthe moment it is for ArcMap only. But you can include WMF layers. With the newest firmware for IPhone/ITouch it should be possible to use the maps. With other mobiles it should be possible when using the new Opera for mobiles. Unfortunately i have no IPhone so i could not test this. You will find examples under http://www.mapviewsvg.com/examples/ But Bruce is right when saying that most of the SVG maps are’nt created for mobile. So the GUI is not perfect for such displays.

  5. volite
    Posted September 19, 2008 at 8:47 am | Permalink

    James – you’re missing several obvious opportunities to inject more ‘Piratese’ into your post.

    e.g. – Aren’t… should’ve been “Arrrrn’t”

    in case you mention ESRI products … “AaaaarrrrcMap”.

  6. Posted September 19, 2008 at 8:47 am | Permalink

    Actually, no, it’s not: What Matt was pointing out is that your primary complaint in that blog post is no longer true as of 2.7: Although the iPhone doesn’t yet support SVG, OpenLayers does support Canvas, so you can have vector rendering without changing a single line of code.

  7. Posted September 22, 2008 at 12:26 am | Permalink

    Christopher it is not correct that IPhone does not support SVG. You can use Safari with IPhone or ITouch. With the newest firmware for IPhone SVG is supported in Safari natively.

  8. Posted September 22, 2008 at 1:11 am | Permalink

    see a short movie about using SVG maps on IPhone http://flickr.com/photos/mac/2876038626/

  9. Posted September 22, 2008 at 4:16 am | Permalink

    Armin:

    Sure. And that wasn’t true until about a week ago, and many people still haven’t updated their firmware. (I can tell, because I’m still getting bi-daily questions regarding why SVG on iPhone doesn’t work in OpenLayers.)

  10. Posted September 22, 2008 at 11:24 am | Permalink

    @ Matt Priour

    I’ve had some of luck getting touch event to control OpenLayers via the technique described here: http://rossboucher.com/2008/08/19/iphone-touch-events-in-javascript/

    It pretty much translates touch events into mouse event OL understands. There’s still alot to be done, but hopefully I’ll have a rough demo up soon.

  11. Posted September 22, 2008 at 2:23 pm | Permalink

    @Whit That sounds really exciting. I had not seen that post before. Looking forward to hearing more and seeing any kind of demo.

  12. Posted October 21, 2008 at 6:36 pm | Permalink

    better late than never, I put up a little demo with an example mouse event emulation and OL and one for a more direct approach as well as a short blog post describing the experiments.

    That being said, at the the advice of Tim Schaub, I’ve been pursuing a more integrated using custom OpenLayers controllers and handlers. I’d love feedback, especially from anyone else who has been working on this or something similar, as this is pretty half baked so far.

  13. Mark
    Posted December 8, 2008 at 12:55 pm | Permalink

    The SVG support in the 2.2 firmware/safari is so painfully slow though. I know it’s because the javascript is being interpreted but shoot it would be so much more useful if it were not horribly lethargic.

  • License

  • Disclaimer

    The information in this weblog is provided "AS IS" with no warranties, and confers no rights.

    This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion and probably incorrect.

  • Meta