Category: Mobile

ArcGIS API for iOS v1.8 Released!!

The ArcGIS API for iOS enables you to build applications that utilize the powerful mapping, geocoding, geoprocessing, and custom capabilities provided by ArcGIS Server using Objective C and deploy them to Apple iPhone, iPod Touch, and iPad devices. The API includes native Objective C libraries, templates, and samples that can be used within the Xcode Integrated Development Environment (IDE).

The Mobile team is proud to announce the 1.8 release of the ArcGIS API for iOS.

Version 1.8 includes the following enhancements:

  • Point to point routing using RouteTask
  • Simplified geometry collection and editing using the SketchGraphicsLayer (includes Magnifier capabilities)
  • Local geometry engine support including capabilities such as Buffer, Project, Union and Difference
  • Support for opening ArcGIS Online “web maps”
  • Ability to create custom callouts
  • Integrated Time Aware capabilities for dynamic and feature layers as well as a new temporal renderer
  • Many more improvements

For a complete list of enhancements included in the 1.8 release, please read What’s New in ArcGIS for iOS API 1.8.

Also, the Mobile Team would like to give a shout out to our many participants in the beta program. Your testing and feedback helps us to deliver quality software products. Thank you.

If you have any questions regarding the use of the API, please post to our user forum. For general inquires, email the dev team at arcgis4iphone@esri.com.

Mobile Team

Posted in Mobile | Tagged , , , , , | Leave a comment

ArcGIS Mobile SDK and Visual Studio Support Explained!

We have received several questions regarding support for versions of Visual Studio when developing applications and extensions using the ArcGIS Mobile SDK and we would like to address the 2 most common questions in this article.

Can I use Visual Studio 2010 to develop Windows Mobile/Windows Embedded Handheld Applications?

Unfortunately No. Microsoft only supports Windows Phone OS 7.0 and higher with Visual Studio 2010. See the following article from MSDN (http://msdn.microsoft.com/en-us/library/sa69he4t.aspx).

What version of the Compact Framework should I use (2.0 or 3.5)?

ArcGIS Mobile is compiled using .Net CF 2.0. Most Windows Mobile devices in the market today are running Windows Mobile 6.1 or 6.5. These devices include .Net CF 2.0. If you build applications that depend upon CF 3.5 then you will need to deploy 3.5 as a part of your install. So unless there is a feature of 3.5 that you must use, we recommend using version 2.0.

Can I use Visual Studio 2008 with Compact Framework 3.5? 

Officially, the answer is YES. However there is some manual work required for you to get the ArcGIS Mobile libraries integrated into Visual Studio…

The problem you will face is that the ArcGIS Mobile components will not appear inside of the Toolbox. The reason for this is that Microsoft does not load .Net CF 2.0 libraries into a CF 3.5 toolbox (even though 2.0 libraries are fully compatible with a 3.5 framework).

You can work around this issue in the following way:

1) Create a CF 2.0 project and design the form using the 2.0 toolbox elements.

 

2) Upgrade your project to a CF 3.5 project. Note that you will still get the same elements in your form but you will no longer have ArcGIS Mobile toolbox items.

 

Alternately, you can directly create your forms in 3.5 by writing the code behind and not using the Toolbox. This is what we do with the ArcGIS Mobile application in fact.

1) Open the Form.Designer.cs file

partial class Form1

  {

    /// <summary>

    /// Required designer variable.

    /// </summary>

    private
System.ComponentModel.IContainer components
= null;

    private
System.Windows.Forms.MainMenu mainMenu1;

    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param
name=”disposing”>
true if managed
resources should be disposed; otherwise, false.
</param>

    protected
override void
Dispose(bool disposing)

    {

      if (disposing && (components != null))

      {

       
components.Dispose();

      }

      base.Dispose(disposing);

    }

 

    #region Windows Form Designer
generated code

 

    /// <summary>

    /// Required method for Designer support – do not modify

    /// the contents of this method with the code editor.

    /// </summary>

    private
void InitializeComponent()

    {

      this.mainMenu1 = new
System.Windows.Forms.MainMenu();

      this.Menu = this.mainMenu1;

      this.components = new
System.ComponentModel.Container();

      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;

      this.Text = “Form1″;

      this.AutoScroll = true;

    }

 

    #endregion

 
}

2) Add references to your CF 3.5 project by browsing for our CF 2.0 library 

 

3) Add the necessary new members.

Normal
0

false
false
false

EN-US
X-NONE
X-NONE

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:”Table Normal”;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:”";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:”Calibri”,”sans-serif”;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:”Times New Roman”;
mso-bidi-theme-font:minor-bidi;}

partial class Form1

  {

    /// <summary>

    /// Required designer variable.

    /// </summary>

    private
System.ComponentModel.IContainer components
= null;

    private
System.Windows.Forms.MainMenu mainMenu1;

 

    /// <summary>

   
/// Esri components

   
/// </summary>

   
private ESRI.ArcGIS.Mobile.WinForms.Map map1;

    private ESRI.ArcGIS.Mobile.FeatureCaching.MobileCache
mobileCache1;

4) Create and Initialize members in InitializeComponent.

Normal
0

false
false
false

EN-US
X-NONE
X-NONE

MicrosoftInternetExplorer4

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:”Table Normal”;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:”";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:”Times New Roman”,”serif”;}

private void
InitializeComponent()

    {

      this.mainMenu1 = new
System.Windows.Forms.MainMenu();

      this.Menu = this.mainMenu1;

      this.components = new
System.ComponentModel.Container();

      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;

      this.Text = “Form1″;

      this.AutoScroll = true;

 

      this.SuspendLayout();

 

     
// Map

     
this.map1 = new
ESRI.ArcGIS.Mobile.WinForms.Map();

     
this.map1.Location = new
System.Drawing.Point(23, 29);

     
this.map1.Name = “map1″;

     
this.map1.Size = new
System.Drawing.Size(200, 200);

     
this.map1.TabIndex = 0;

     
this.map1.Text = “map1″;

     
this.Controls.Add(this.map1);

 

     
// Cache

     
this.mobileCache1 = new
ESRI.ArcGIS.Mobile.FeatureCaching.MobileCache(this.components);

 

     
this.ResumeLayout(false);

    }

 

5) You should get the following result.

 

Given that the time you will spend designing the form is negligible, we recommend the later approach for your 3.5 development.  

 

 

Posted in Mobile | Tagged , , , , | Leave a comment

Data Collection Playground and ArcGIS on Smartphones

Your iPhone, Windows Phone, iPad or iPod Touch can become a powerful tool for field data collection. Using the ArcGIS application that is available from Apples’ App Store and the Windows Phone Marketplace, you can collect GIS features using the GPS receiver in your device or by sketching on the map, fill out intelligent attribute forms  and attach photos/videos to them. All edits are instantly synchronized with your enterprise geodatabase.

Getting started is as simple as using your smartphone. The Mobile team has hosted a number of data collection maps in a group called “Collection Samples” that is accessible directly on your phone and can be found inside of the Gallery. Here is how you can access the collection maps using your iPhone…

After tapping on one of the maps in the Collection Samples group (Infrastructure for example), you will find that the map itself contains additional functionality within the Map Tools called Collect. Tap on Collect to choose a Feature Type or Template from the editable map layers and then follow the additional steps to collect a new GIS feature.

These maps are available using ArcGIS Online and are publicly shared in a group called Esri Data Collection Playground for you to get started with. Feature layers provide templates for data collection inside of the ArcGIS application. Each of the collection sample maps available within the smartphone app have an associated Map Package that you can download to your server as well. To find the map package, look at the details of the map inside of ArcGIS Online. Looking at the details of the Infrastructure Map you will find a link to the Infrastructure Map Package. Opening the map package you can then host your own Feature Service and then either use ArcGIS Online or your own on-premise server to host maps for use on your smartphone device.

We would like to see you start leveraging smartphones for data collection today. Please try the Collection Sample maps and let us know what you think. Send your feedback to arcgis4iphone@esri.com.

NOTE: The features you add to the maps hosted inside of the Esri Data Collection Playground are archived and then scrubbed nightly. Please do not expect features to be maintained. This is a playground and we are here to pick up after your edits…

Also, ArcGIS will be coming to Android devices very soon and the capabilities listed above will be available to your favorite Droids in the near future…

Thank you!

Mobile Team

Posted in Mobile | Tagged , , , , , | 1 Comment

New beta for Silverlight, Windows Phone and a new Viewer

Yesterday the following was added to the ArcGIS Beta Community at: http://betacommunity.esri.com

  • ArcGIS API for Microsoft Silverlight
  • ArcGIS API for Microsoft WPF
  • ArcGIS API for Windows Phone
  • ArcGIS Viewer for Microsoft Silverlight

These are all public (open) betas that anyone can join. So if you are Microsoft developer, today is a good day.

Posted in Developer, Mobile | Tagged , , , , | Leave a comment

ArcGIS Application for iOS v1.8 Available On App Store

The iOS development team has updated the ArcGIS application and it is available for download now on the Apple App Store. You can download it now.

The purpose of this update is to expand the reach of the ArcGIS application to more country app stores! ArcGIS has been localized into the following languages:

  • French
  • German
  • Spanish
  • Japanese
  • Simplified Chinese

In addition, the application refresh provides forward compatibility with the upcoming release of ArcGIS Online.

IMPORTANT NOTE: If you have previously installed the ArcGIS application on your iOS device and have an existing ArcGIS Online account that you sign in to, you will need to uninstall ArcGIS prior to installing the update. If you tap on ArcGIS within the Update tab of the App Store application to install the update, you will not be able to sign in to ArcGIS Online using your username and password. If you have already installed the update and cannot sign in, simply delete the ArcGIS application from your device and then re-install it from the App Store. Our apologies for any inconvenience this may cause.

Mobile Team

Posted in Mobile | Tagged , , , , , | 1 Comment

ArcGIS API for iOS v1.8 Beta is live!

The iOS development team has just released an open, public beta for the next release of the ArcGIS API for iOS. It is available for download from our beta community site now! Sign up for the ArcGIS Beta Community at http://betacommunity.esri.com and click on the “ArcGIS API for iOS” link to join!

The 1.8 beta release builds upon the success of our 1.0 release and introduces the following new capabilities:

  • a Sketch layer to easily create and edit geometries
  • a magnifier for the map
  • a high-performance, native, Geometry Engine to perform sophisticated geometric operations locally on the device
  • support for web maps
  • a new Route Task to generate point-to-point routes and driving directions using Network Analyst services.
  • support for map to wrap around the dateline
  • enhanced callout customization including the ability to display custom views in the callout
  • much more…

We are looking forward to having you join our beta program and more importantly using the ArcGIS API to build new and exciting applications for the iPhone, iPad, and iPod Touch devices!

Mobile Team

Posted in Mobile | Tagged , , , , , | 1 Comment

The ArcGIS API for Android Beta Program is now Open!

We are excited to announce that the ArcGIS API for Android is in public beta and available for download…. more details.

Posted in Mobile | Tagged , | Leave a comment

New Training Courses Available

Thanks to the hard work of Kris Bezdecny and Violet Michniuk from our Education Services team, there are two new web training courses that will guide you through the process of creating maps for use with iOS and Windows Phone devices as well as a targeted course on how to use the ArcGIS application on your iOS device:

Creating Web Maps for Lightweight Mobile Apps

This course guides you through the process of creating operational maps and services that exploit the query and editing capabilities of our lightweight mobile applications as well as how to publish web maps using ArcGIS Online.

Using the ArcGIS for iOS Application

Following the course on how to create web maps, this course focuses on the feature functionality of the ArcGIS application. You will learn how to access web maps, search for map data, collect and edit data and attach media to what you collect.

Posted in Mobile | Tagged , , , , , , | Leave a comment

Developing a custom tiled layer

Introduction

ArcGIS API for iOS provides a number of predefined layers that work with GIS Servers such as ArcGIS Server, Bing Maps, etc. These layers retrieve map images from the GIS Server and display them on a map. Layers can be broadly categorized into two types – Dynamic layers and Tiled layers. Dynamic layers display maps using images that are generated on the fly. Tiled layers display maps using pre-generated map images, also known as tiles. These tiles are usually hosted on a server and can be accessed via a URL. The format for the URL depends upon the tiling scheme used by the provider to organize the tiles. 

The API also provides an extensible framework that allows you to develop your own custom layers. In this post, we will focus on developing a custom tiled layer. Instead of accessing tiles from a server, our layer will use tiles that are bundled with the application. For the sake of brevity, we will only discuss the high-level aspects of creating the layer. The full implementation of the layer is available as a sample.

Map Cache

To use the custom layer, a map cache needs to be embedded in the application bundle.

A map cache contains map images. These images are organized within folders representing Levels and Rows. The name of the image files represent Columns. Names for Level folders begin with the letter ‘L’ followed by a number in decimal format. Names for Row folders and Column images begin with a letter (R for row, and C for column) followed by a number in hexadecimal format. For example, Level 11 is represented by L11 and Row 11 by R0000000b. The cache also contains two XML files – conf.xml and conf.cdi. These files contain metadata about the cache such as the tiling scheme and the full extent.

Note, if your cache was generated with a 9.3.1 ArcGIS Server or older, it may not contain the conf.cdi file. You need to upgrade the service to ArcGIS Server 10. This will automatically create the file for your existing cache.

Also note, ArcGIS Server 10 supports two cache formats – Compact and Exploded. The custom layer discussed in this post only works with exploded cache format.

When you include a cache in your application, be sure to include the entire folder hierarchy of the cache, starting with the top-level folder. The top-level folder usually has a name beginning with “cache_”. The top-level folder contains a folder whose name matches the data frame in the map document which was used to create the cache. The data frame folder usually contains a folder called “_alllayers” In the example shown, “cache_World” is the top-level folder and “Layers” is the data frame folder.

To add a cache to your application, right-click on the Other Sources group in your XCode project, choose Add > Existing Files. Navigate to the top-level map cache folder. Enable Copy items into destination group’s folder, and select the Create folder references for any added folders option. Click Add to finish.

Note: If you have large number of tiles, it may take a lot of time to copy them into the project directory. To avoid this delay, you can disable the Copy items into destination group’s folder option when adding the cache to your application. By doing this, the cache will still get included in your application bundle, but XCode will skip copying it to your project directory. 

Map caches can be quite large depending upon factors such as the extent and scale levels of the cache. The size of your application could increase dramatically by including the cache. iOS applications can be as large as 2GB but the application must be under 20MB to allow over-the-air downloads. See the ITunes Connect Developer Guide for more information.

Design

All tiled layers in ArcGIS API for iOS extend from the AGSTiledLayer class. This class in-turn extends from AGSLayer. AGSTiledLayer and AGSLayer provide a lot of supporting infrastructure for implementing tiled layers. By inheriting from these classes, we can focus exclusively on the aspects that are unique to our layer. We don’t need to worry about, for instance, positioning tiles correctly on the map, or scaling tiles in response to a pinch. All we need to do is provide some metadata about the layer and implement the mechanism for retrieving tiles.

To create our custom layer OfflineTiledLayer, we too will extend  from AGSTiledLayer.

@interface OfflineTiledLayer : AGSTiledLayer  {
   
}

Any layer that extends AGSTiledLayer must provide information about its tiling scheme and implement the mechanics to retrieve tiles. The tiling scheme is used by the map to calculate which tiles fit within the map’s bounds.  The map then requests the layer to fetch those specific tiles that need to be displayed.

@implementation OfflineTiledLayer 

 -(
AGSTileInfo*) tileInfo { //todo } 
 -(NSOperation<AGSTileOperation>*)retrieveImageAsyncForTile:(AGSTile*) tile   {
 
  //todo }
 … 
@end

By virtue of extending AGSTiledLayer, a layer also indirectly extends AGSLayer. The layer needs to provide some basic information such as it’s fullEnvelope, initialEnvelope, spatialReference, and units. AGSLayer defines read-only properties for these parameters. Our custom layer implements getter methods for these properties -

@implementation OfflineTiledLayer
 

 -(AGSUnits) units { //todo  }
 -(AGSSpatialReference*) spatialReference { //todo } 
 
-(AGSEnvelope*) fullEnvelope { //todo } 
 
-(AGSEnvelope*) initialEnvelope { //todo } 
@end

Finally, our layer defines an initialization method that requires a path to the data frame folder in the cache. The method also accepts a reference to an error object so that it can return an error if problems are encountered while reading the cache.

@interface OfflineTiledLayer : AGSTiledLayer  {
  - (id)initWithDataFramePath:(NSString*)path error:(NSError**)outError;  
}

Implementation

The following diagram provides an overview of how the OfflineTiledLayer works. To cleanly separate responsibility, the layer uses a dedicated class called OfflineCacheParserDelegate to parse the XML files in the cache. To actually retrieve tiles from the cache, the layer uses objects of an OfflineTileOperation class.

The bulk of the work is done during layer initialization. This is when the layer uses OfflineCacheParserDelegate to parse metadata in the conf.xml and conf.cdi XML files. These files contain information about the layer’s tiling scheme and extent respectively.

- (id)initWithDataFramePath: (NSString *)path error:(NSError**)outError {
 
 OfflineCacheParserDelegate* parserDelegate = [[OfflineCacheParserDelegate alloc]  
    init
];
 //Parse the conf.cdi file 
 NSString* confCDI = [[NSBundle mainBundle] pathForResource:@”conf”
                                                    
ofType:@”cdi”
                                               
inDirectory:_dataFramePath];
 NSXMLParser* xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:[NSURL       
                                                     fileURLWithPath
:confCDI]]; 
 
[xmlParser
setDelegate:parserDelegate];
 [xmlParser parse]; 
 
[xmlParser
release];   

 //Parse the conf.xml file
 NSString* confXML = [[NSBundle mainBundle] pathForResource:@”conf” 
    
ofType:@”xml” 
   
inDirectory: _dataFramePath]; 
 
xmlParser = [[
NSXMLParser alloc] initWithContentsOfURL:[NSURL 
                                         
fileURLWithPath:confXML]]; 
 
[xmlParser
setDelegate:parserDelegate];
 [xmlParser parse]; 
 
[xmlParser
release]; 
 

}

OfflineCacheParserDelegate decodes the information and makes it available as AGSTileInfo and AGSEnvelope objects. The layer then uses these objects for implementing the properties defined in AGSLayer and AGSTiledLayer. Finally, the layer indicates it is loaded by invoking the layerDidLoad method.

- (id)initWithDataFramePath: (NSString *)path error:(NSError**)outError {
 
  _tileInfo = [[parserDelegate tileInfo] retain];
  _fullEnvelope = [[parserDelegate fullEnvelope] retain];
  [self layerDidLoad]; 
 

} 

- (
AGSTileInfo*) tileInfo {  return _tileInfo; } 
- (AGSEnvelope*) fullEnvelope { return _fullEnvelope; } 

When the layer is added to the map, the map requests for tiles that need to be displayed within the map’s bounds. For each tile, the map invokes the layer’s retrieveImageAsyncForTile: method. To improve performance, tiled layers use an operation queue for retrieving tiles. This operation queue is provided by the parent AGSTiledLayer. The queue allows multiple tiles to be retrieved concurrently in the background. A tiled layer creates an operation object for every tile that needs to be fetched and adds it to the queue. The queue then runs these operations and removes them when they finish executing. Operation objects used by tiled layers must conform to the AGSTileOperation protocol.

OfflineTiledLayer uses a custom class, OfflineTileOperation, to retrieve tiles from the local cache. The operation object is given information about which tile to retrieve, the path to the local cache, and a target-action pair representing the method to invoke when the operation finishes.

- (NSOperation<AGSTileOperation&gt
;*) retrieveImageAsyncForTile: (
AGSTile*) tile {  
 
 //Start an operation to fetch the tile   
 OfflineTileOperation
*operation = [[OfflineTileOperation alloc] initWithTile:tile
                                      dataFramePath:_dataFramePath 
                                             
target:self 
                                             action:@selector(didFinishOperation :) ];
  [super.operationQueue addOperation :o peration];
  return [operation autorelease];
}

When the operation finishes, it invokes the didFinishOperation: method on the layer. The layer then checks to see whether the operation found a tile image or not. It then appropriately notifies the tileDelegate. The tileDelegate ensures that the tile is correctly displayed on the map.

- (void) didFinishOperation:(NSOperation<AGSTileOperation>*)op { 
  //Check if a tile was found…
 
if
(op.tile.image!=nil) {
     //… inform the delegate of success 
 
  
   [self.tileDelegate tiledLayer:self operationDidGetTile :o p]; 
  
}
else {
     //… inform the delegate of failure 
 
    [self.tileDelegate tiledLayer:self operationDidFailToGetTile :o p]; 
 
}
}

Summary

In this post we saw how to develop a custom tiled layer that reads tiles from a map cache embedded within the application. To use the layer with your own data, you need to publish the data as a map service on ArcGIS Server and then create a cache for the service. You can then copy the cache over to your development machine and include it in your iOS application.

Once the cache and the custom layer are included in your application, all you need to do is instantiate the layer with a path to your cache’s data frame folder and then add the layer to the map -

NSError *err;
NSString *dataFramePath = @”cache_World/Layers”; //Path to your cache 
OfflineTiledLayer *tiledLayer = [[OfflineTiledLayer alloc] initWithDataFramePath:
     dataFramePath
error: &err];



UIView
*tiledLayerView = [self.mapView addMapLayer:tiledLayer withName:@"Custom Tiled Layer"]; 

Contributed by Divesh Goyal of the ArcGIS for iOS Development Team

 

Posted in Mobile | Tagged , , | Leave a comment

ArcGIS for iOS Application v1.5 Released!

The Mobile team has released a new update for the ArcGIS application and it is available now on Apple’s App Store for you to download and use.

Version 1.5 of the ArcGIS application includes the following enhancements:

Data Collection and Editing

  • Now you can use GPS or the map to collect and update GIS data (points, lines and polygons).
  • Attach photos and movies to what you collect.
  • Enter attribute details using intelligent forms that are driven by ArcGIS data models (domain-driven pick lists, date controls, etc).
  • Includes a set of hosted industry specific sample maps that serve as a data collection playground. To find them within the application, look inside of the new Gallery entry on the Find Maps tab.

Tap on Map Identify

  • We have simplified the experience of identifying locations on the map. A simple tap on the map replaces the Identify Location tool.

Magnify your Identify and Editing experience

  • When interacting with the map, you can be more precise in where you tap by holding your finger on the map and using a Magnifier to place a vertex when collecting a feature or a pin when identifying a feature.

Streamlined ArcGIS Online account creation

  • We have streamlined the way that you create an ArcGIS Online account. Now you can create your account directly within the ArcGIS application by entering basic account details.
Posted in Mobile | Leave a comment