A lot of people have asked us when we will add support for the iPhone, Blackberry and what about Android? Imagine the reaction we receive when we the answer is - we already do! Well, sort of. To explain, lets first discuss the target user of ArcGIS Mobile and then discuss how the Mobile Web fits into the picture...
Enterprise Field Worker
ArcGIS Mobile is designed and engineered to fit the needs and workflows of the enterprise field worker. Viewing and navigating to locations, collecting new spatial and tabular data, and locating/updating existing assets in the field are all common tasks for the enterprise field worker. They demand highly focused, workflow driven applications that are fully functional whether you are connected in the field or not. Where do you find the enterprise field worker? He/she inspects their city infrastructure, performs state or county surveys, responds to incidents when something bad happens, and much more. They leverage the corporate investment in GIS to manage their infrastructure in the field.
The Mobile Consumer
Those local and state agencies that are moving to ArcGIS Server and deploying mobile GIS to their field operations using ArcGIS Mobile are not the only field workforce that consumes corporate spatial data - citizens within a local government, tax payers within a county are as well. The mobile consumer wants to discover corporate information that is managed by their state or local government. For example, why can't I see all of the recycling centers in my city using my iPhone or Blackberry? How about public transportation routes and schedules?
So how can a local government support so many different devices...
ArcGIS Server and Mobile Web Browsers
Mobile browsers come in a variety of flavors. They range from browsers that support basic or partial HTML rendering to those which support full HTML, JavaScript & CSS. Leading the pack right now is the iPhone Safari with support for all the above plus SVG graphics with JavaScript binding and an on device database. Several other mobile device manufacturers also integrate full fledged browsers, including Opera Mobile/Mini, Mobile Explorer, Blackberry Browser, etc. (A comprehensive list can be found at http://en.wikipedia.org/wiki/Microbrowser).
At the 9.3 release, ArcGIS Server includes REST access to mapping and other geospatial services. These services can be easily accessed through simple HTTP calls, which can be made through any server side scripting language such as Php, Perl, Ruby, Python, etc or languages such as Java & C# or within client applications through JavaScript or FLEX/ActionScript.
Simple Web Mapping
With the rest of this blog posting, we will explain how you can use the new ArcGIS Server REST API to add a map into an HTML page and allow basic map navigation using links on the page and serve your consumers with your corporate data. We will use one of the ArcGIS Online map services as the map to display.The following is the PHP code for building this simple mobile web mapping application.
- Determine the size of the map image to be requested, based on the browser's USER-AGENT.
$userAgent = $_SERVER["HTTP_USER_AGENT"];if (strstr($userAgent, "iPhone")) {
...
}else if (...) {
...
}
else {
echo $userAgent;
}
- Determine whether there is an extent already passed to it in the url query or initialize the map to a pre-defined extent.
$bbox = $ _ GET["bbox"];
if ($bbox == "") {
$bbox = "...";
}
$bbox = explode(",", $bbox);
$left = (double) $bbox[0];
...
- Create image request to ArcGIS Server REST, passing size, format and extent information in the image url
"<img src=\"http://server.arcgisonline.com/.../export?f=image&format=jpg&bbox=" . $left . "," . $bottom . "," . $right . "," . $top . "&" . $size . "\" width=\"" . $imgWidth . "\" height=\"" . $imgHeight . "\" />";
- Calculate extents and create links based on navigation operations; zoom in/out and pan north/east/south/west. These links call the page itself and pass the calculated extent.
"<a href=\"" . $base . "?" . "bbox=" . expand($left, $bottom, $right, $top, $width, $height, 0.5) . "\">+</a> | ";
"<a ...>-</a> || ";
...
"<a href=\"" . $base . "?" . "bbox=" . offset($left, $bottom, $right, $top, $width, $height, 0, $panFactor) . "\">N</a> | ";
"<a ...>E</a> | ";
"<a ...>S</a> | ";
"<a ...>W</a> | ";
...
The following are screenshots of this simple mapping application running on different device emulators:
iPhone 2.1

Blackberry Curve (8320)

Android (v1)

This blog post is the first in a series of blog entries that will be published on how you can leverage the Mobile Web. Thanks go to Jayant Sai (lead developer of the Javascript API) for contributing this article.
Mobile Team