Mobile Devices
There are several options available for making use of GeoSmart map tiles on mobile devices:
API Comparison
Each API has different strengths which can be considered when making a choice as to which API to use. The table below compares the various options available at this time:
| Feature | GeoSmart Map API | OpenLayers | Tile5 | Route-Me |
|---|---|---|---|---|
| Target | Mobile Web | Mobile Web | Mobile Web | Native iOS Application |
| Coordinate System | NZMG | NZMG, WGS84 and others | WGS84 | WGS84 |
| Countries Supported | NZ | NZ, Australia | NZ, Australia | NZ, Australia |
| Supports GeoSmart Directions API? | Yes | No | No | No |
| Supports WMS Layers? | Yes | Yes | No | No |
| Supports WFS Layers? | No | Yes | No | No |
| iOS Support? | Yes | Yes | Yes | Yes |
| Android Support? | No | Yes | No | No |
| Blackberry Support? | No | Untested | No | No |
| Windows Phone 7 Support? | No | Yes | No | No |
| Recommended Version | 3.2.2+ | Trunk (or stable 2.11+ once available) | 0.9.3.1+ | Latest |
| More Information | Website | Website | Website | Website |
Viewport Meta Tag
To ensure correct scaling of your mobile page and the map display, a viewport meta tag should be included in the "head" of your HTML page. e.g.
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
For further information: http://learnthemobileweb.com/2009/07/mobile-meta-tags/
Usage
Below is information and examples showing how to make use of our map tiles with the various APIs. You can use the "view source" function in your web browser to view the complete source code of the examples.
GeoSmart Map API
As of version 3.1.32, the GeoSmart Map API includes mobile support by default. Simply use it in your website and touch panning and zooming will be available.
OpenLayers
OpenLayers is a flexible open source mapping library with support for a wide range of web mapping protocols. The OpenLayers project has recently conducted their "mobile code sprint" in an effort to add support for mobile devices. This is not available in the current stable release (2.10), however is available in trunk. OpenLayers can be used with either our NZMG or Spherical Mercator map tiles. The examples below make use of our Spherical Mercator tiles.
Simple example, Advanced example using Sencha Touch (requires webkit-based browser) (download source).
Tile5
Tile5 is an open source HTML5 mapping library targeting mobile devices.
Route-Me
Route-Me is an open source map tile viewer for iOS applications. We do not provide example source code for Route-Me however, it can be used with our Spherical Mercator maps tiles. The URL format is:
http://mt.geosmart.co.nz/world/carto/{z}/{x}/{y}.png 
