Same blog, new name

Today we shortened the title of this blog to “ArcGIS Server Blog”. We removed “Development” from the name because the blog has come to include many topics of interest to non-developers.

You won’t notice any change in subject matter on this blog. It is still written by the ArcGIS Server software development team and will still contain many developer-oriented posts.

We’d like to thank you for reading the blog and for participating through your comments and e-mails.

The ArcGIS Server Software Development Team

Posted in Services | Tagged | Leave a comment

Geodatabase Replication – Additional info & Patch

This post was written by Heather McCracken and Gary MacDougall, both product engineers on the geodatabase team specializing in geodatabase replication

We just wanted to give you a heads up that there are a number of resources available which provide additional information on geodatabase replication. These include white papers, podcasts and technical articles. We’ve been keeping a knowledge base article that lists these helpful resources. This is a living document, so we’ll be continually updating it as new resources become available. You can find the article here

Also, there is a new patch for replication available for 9.2’s service pack 6. The patch addresses issues when synchronizing data where there are relationships that use the objectID column as the primary key. You can download the patch at the following location:

ArcGIS (Desktop, Engine, Server) 9.2 Synchronizing with Objectid Based Relationship Classes Patch


Posted in Geodata | Tagged , | 2 Comments

Live training seminar to demonstrate map caching strategies

During the past several weeks I’ve been working with Danielle Hopkins of ESRI Educational Services to prepare a live training seminar on ArcGIS Server map caching. The seminar is free and will be broadcast three times this Thursday, August 28 or you can watch it later in the seminar archives. This page has more information about how and when you can tune in to the seminar.

We prepared this seminar with two main goals in mind. First, we wanted to focus on caching strategies. The seminar will explain what map caching is and how to do it, but that is really just the beginning of successful caching. There are many things to think about when you create a cache, including how to design your map, how to choose a tiling scheme, where to create tiles, how to update the tiles, and so on. In this seminar, we’ll show some best practices and how to implement them using, in many cases, new features available at ArcGIS Server 9.3. Hopefully you’ll learn something new even if you’ve been caching for a while.

Second, we wanted to teach caching by showing it, so the presentation will include four demonstrations that might be similar to caching scenarios that you face. We’ll show how to create a base map cache, how to create an overlay cache that gets updated nightly, how to create a partial cache that gets filled in on demand, and how to create a cache for a Web mashup. At multiple points throughout the presentation, we’ll pause to take questions that you submit.

We look forward to seeing you on Thursday!

Update: The archived seminar is now available at

Contributed by Sterling Quinn of the ArcGIS Server software development team

Posted in Services | Tagged , , , , | 3 Comments

Deploying your ArcGIS Mobile solution

An extremely important and challenging step in building an effective mobile solution is the deployment of it. Deployment involves packaging all of the information required to complete operations in the field and getting that information into the hands of your field workers so they can be efficient and productive with the software and data you give them.

I would like to focus this blog entry on deployment of the ArcGIS Mobile application, mobile projects and data to Windows Mobile handheld devices. If you need to deploy a custom mobile solution to laptops or tablets, you should take a look at a code gallery posting we have for building a mobile runtime.  


There is no “one solution fits all” when it comes to deploying mobile solutions. Factors such as the size of your field workforce, the devices that they use in the field, the volume of data required for field use, and the frequency you need them to synchronize with the office all influence the choices you will make. Let’s not forget to factor in IT infrastructure either!

It all boils down to 2 methodologies. Either you “push” information to devices or you “pull” information from a server to your device. There are a number of 3rd party deployment systems in the marketplace today that you can use to “push” deployments to devices (Microsoft, SOTI, and Motorola are a few companies that offer solutions). With ArcGIS Mobile, we offer a web-centric solution for the “pull” model out-of-the-box by creating a web site and web service that hosts your mobile projects and the ArcGIS Mobile application. More on that a little later.

Windows Mobile and CAB files

First it is important to understand that Windows Mobile devices use cabinet files (.CAB files) as a compressed installer for applications and CAB files can be used for other information (such as map data). Marcus Perryman wrote an interesting blog article on MSDN explaining cabinet technology so I won’t go into details on the technology here.With ArcGIS Mobile at 9.3, we include a .CAB file for the out-of-the-box application and provide that CAB file as a link on a web page that you can download from your mobile device. Deploying the ArcGIS Mobile application to a mobile device is as simple as clicking on the CAB link from your device.

Note that at 9.3 we also include a CAB for the SDK runtime as well. You can use the SDK runtime in the deployment of your custom Windows Mobile application.We recently posted a code gallery entry on how you can create a .CAB file for your application that includes this SDK runtime CAB using Visual Studio. 

ArcGIS Mobile Web Site 

When you install ArcGIS Server at 9.3, a new web site is created to help you manage your mobile deployments (http://yourWebServer/yourInstance/Mobile). This web site is optimized for mobile browsers as well. It contains a link to the .CAB file for the ArcGIS Mobile application, and links for each of the projects that you create inside of the Server Manager as shown below. Projects are xml files that configure the ArcGIS Mobile application with data and tasks.

From your Windows Mobile device, you can use the web browser and navigate to the web site on your server, download and install the application by clicking on the link, and download the mobile project which configures the mobile application to use appropriate map data and tasks for your work in the field.

Using the ArcGIS Mobile application you can open the project and pull map data from the server using the Synchronize task. Pulling map data from the server to the device can take time if are wireless so be careful…

What would be more efficient is to pre-cache the data, create a .CAB from it, and somehow get this CAB file to the mobile device. But how?

Creating a Data Deployment Cache

Within ArcGIS Desktop, you will find a new toolset in the ArcToolbox window that contains 2 new geoprocessing tools for building mobile datasets:

Ignoring the Create Mobile Basemap tool for a minute, lets discuss the Generate Mobile Service Cache tool. This tool inputs a connection to your mobile service, lets you pick a set of map layers and an extent, and creates an output cache into a defined folder location. For your mobile projects, you can create caches using this tool for deployment to devices.

The Create Mobile Basemap tool can be used to build a highly compressed mobile base map. This tool uses a map document as input and creates a folder of SDC files. Inside of the project you define you can specify a base map when determining the layer source. Please read more about preparing maps and data to understand how you can leverage base maps inside of ArcGIS Mobile.

Building a Data Deployment CAB

Once you have built a mobile service cache, you can then create a data deployment CAB. If you are savy in the ways of Visual Studio, you can use it to create a CAB file from your mobile service cache. But if not, we have put a utility application that you can use to create your own cache on the code gallery called the Data Deployment Utility. Using this tool, you can create a CAB file for your mobile cache.

Tweaking the Mobile Web Site

The ArcGIS Mobile application CAB file and each of the mobile project files are stored on your web server. You can find these files at: \yourServerInetpubwwwrootyourInstanceMobile. Projects are stored in the Project folder, the CAB file is located in the Software folder.

Also at that folder location you will find 2 ASP web pages – Default.aspx and MobileDefault.aspx. As you might expect, MobileDefault.aspx is the web page loaded when you access the site from a mobile web browser and Default.aspx is the web page loaded from a Desktop. You can extend either web page with your own information and/or links to other downloads.

The <body> tag inside of MobileDefault looks like this:
    <form id=”form1″ runat=”server”>       

You can extend the page with your own content with something like this (in bold) where the:

    <mobile:Form id=”mobileForm” runat=”server”>        
              <a href=”MobileApplication.ashx?file=ProjectXData.CAB”>
                Project X Data CAB</a>


If ProjectXData.CAB is located in the software folder, the end result will be a new link for your data CAB directly below the project list like so:

New CAB Link

From your mobile device you can click on the new link added to the MobileDefault.aspx web page and it will download and install the mobile service cache onto your device.


Deployment is an important step in building an effective and efficient mobile solution. There are a number of factors to consider when choosing a deployment methodology and there are deployment systems that you can purchase to make the deployment process easier. ArcGIS Mobile provides a very simple, out-of-the-box experience for deployment that you can extend for your needs. Remember that deployment can make or break the success of a mobile solution. Spend time in analyzing how deployment best fits into your field operations before making any decisions.

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

Quick Content

The Quick Content task is a recent addition to Explorer, introduced with the 480 release in June. It provides a simple way to create your own Web-based menu for adding and displaying information using ArcGIS Explorer. The following video clip shows how you can access the task, and begin using it:

The Quick Content task is not in the collection of tasks you see when you open the default map. But you can add it very easily by choosing Tools > Manage Tasks. You’ll see it at the bottom of the default tasks list, just highlight it and use the arrow to move it to the right hand available in this map list.


When you first open Quick Content, you’ll see a sample page that you can use as a template.

Click GeoTagged photo, and you’ll automatically zoom to a result location (in this case the ESRI campus) and will see a photo appear in the popup window.

How’d we do this? The Quick Content example is just a Web page, and it could be anything that we can display in a browser. If we look at the Quick Content source (right click in the content and choose View Source), you’ll see that the link we clicked to view the photo references an NMF file.

To create the NMF file we used the Create Note task to add a note result, using the the photo of the ESRI campus in the note description so it would open in the popup window. With the popup window open, we exported the result, and put it in a location that anyone could access (also making sure the ESRI photo could be externally accessed).

You can create your own Quick Content page, then just paste your URL into the address at the top. Below we used a local path, but obviously if you want this to be available to others in your organization or extenally, you would need to place it in an location that can be accessed externally. When you save your map your custom Quick Content will be available every time you open it.

You can add your own layers, results, and even tasks to the Quick Content, even making your own complete resource center (there are other ways to link your own resource center directly in Explorer using your own home server, which we’ll cover in a future post). 

A Quick Content task was also demonstrated during the recent User Conference Plenary, covered in this blog post.

For more information see the Quick Content Help topic.

Posted in Uncategorized | Tagged , | Leave a comment

Code Snippets: write 'em, save 'em, reuse 'em

The “DRY” principle describes an element of programming efficiency:  Don’t Repeat Yourself.  

One of the tools available to help you with this are Code Snippets.  ArcGIS 9.3 products ship with hundreds of these snippets you can quickly and easily find and use, but how can you create them, add to this repository, and share them with others?

Back on July 14th, Don Kemlage from the ArcGIS SDK team posted a video here on the blog to describe what snippets are, how to get to the ones we provide with ArcGIS, and how to use the Snippet Finder.   At about 10:50 minutes into that video, Don mentions briefly that developers can make their own snippets too.  In this post here, we wanted to dig a little more into that, and provide some tips on how to do it in more detail.

Frameworks such as Visual Studio and Eclipse provide several ready-to-use Code Snippets.  You can even add your own snippets into the library, organizing them into a directory structure by the subject or task they accomplish. Creating your own code snippets helps you and your team members have snippets which are greatly customized for your development.

Code snippets are defined in XML format and are stored with the *.snippet file extension. You can use your favorite XML or text editor or Visual studio or Eclipse to create and maintain them.


Creating Code Snippets in Visual Studio 2005/2008

MSDN has a nice concise “How To” article on creating code snippets.

In short, using Visual Studio 2005/2008 start with the File > New > File > XML File menu item.  That allows you to create the new file and save it in place, ready for editing.  Then the next step is to plug in the required information to make it an individual code snippet. Let’s show you an example code snippet, then further below we’ll explore the tags one by one.


Let’s walk through it, top to bottom.

The <CodeSnippets> element is the root element of the code snippet XML schema and has xmlns attribute value.

The  <CodeSnippet> element is used to create an individual code snippet and this is where all declarations on your snippet must reside.

Header, Title, Shortcut, Description, Author, SnippetTypes
The <CodeSnippet> tag has a <Header> section that contains information needed by the IDE in these additional tags.  Visual Studio gives you a description of what each one does when you hover your mouse on these tags. 

The <Snippet> tag is a little bit more complex. It contains both the <References> and <Code> tags.

 The <References> tag is used by the IDE to add references to the project when the snippet is inserted. In this example, the code snippet adds a reference to ESRI.ArcGIS.esriSystem.dll when the snippet is inserted. Note that Visual C# code snippets do not support the References section, so a reference to ESRI.ArcGIS.esriSystem.dll must be added to the project manually.

The <Code> tag contains the specific code to insert as <Code Language=”VB”> that says that the language of the code snippet is Visual Basic. All snippet code must be placed between <![CDATA[ and ]]> brackets. You can also mention (in comments) what ArcGIS Products and which versions (9.2, 9.3) can use this snippet and any other namespaces that you wish the user imports before adding.

Ok, so after doing this a couple of times they are pretty simple to create.  And whether you write them using Visual Studio or a plain text editor, give each one a *.snippet file extension and use the Tools > Code Snippets Manager menu item to ensure the IDE knows where these folders are.

Code Snippets not only provide a wide variety of productivity-enhancing solutions and their real power lies in their extensibility. Give them a shot.

Contributed by Sirisha Karamchedu from ESRI Educational Services

Posted in Developer | Tagged , , , | 2 Comments

Explorer 500 Home Server files now available

The new ArcGIS Explorer 500 Home Server files are now ready for download from the Explorer download site.

Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment

New Community Center for ArcGIS Mobile!

The ArcGIS Mobile Resource Center introduced a new Community Center today!

The goal of the Community Center is to grow a vibrant online community centered around Mobile GIS. The community center aggregates all sources of information that change frequently so you have the most recent information. It includes this blog site, forums, knowledge base articles, and a code gallery for developers.

With the launch of the community center, the mobile dev team has uploaded a number of code samples that you can download in the code gallery. All samples uploaded by the dev team are clearly indicated by the “ArcGIS Mobile Development Team” tag on the sample.

During our presentations at UC2008 (both in the technical workshops and at the Mobile Island Demo Theatre), we wrote a lot of code and those of you who attended our presentations have asked for us to share it with you. So the code samples prefixed with “ArcGIS Mobile – ” are exactly those samples. Once you have taken a look, please come back to the code gallery and give these samples a rating!

To post your code to the code gallery, all you need to do is log into the code gallery using your ESRI Global account. If you do not yet have one, you can sign up for one here.


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

Silverlight and Web ADF integration

Working with Silverlight and the ArcGIS Server Web ADF for Microsoft .NET

Microsoft Silverlight delivers the next generation of .NET based media experiences and rich interactive applications for the Web. In this article we will discuss how to augment the user experience of your existing ArcGIS Server .NET Web ADF applications by embedding Silverlight UI components. We will also discuss how you can add GIS capabilities to any Silverlight based site by integrating it with the .NET Web ADF components.

Silverlight 2 allows for a number of features, including but not limited to:

  • Calling .NET code from JavaScript
  • Calling JavaScript functions from .NET code
  • Manipulating the XAML render tree using JavaScript

In this post you’ll explore each of these features, and the classes within the System.Windows.Browser namespace that empower this functionality.

Try it live

Download the full project including test Web site

You need to install the following applications and components to work with the solution provided in this post:

Exposing .NET Functions to the Browser

Within the project directory you will find a .NET solution named ADFinSL. Open the solution using Visual Studio 2008 and run it. You will see a screen like what is shown in Figure 1. The list at the top left is a Silverlight object. Underneath it are three HTML Input controls (buttons) and to the right is a Web ADF Map control. Pressing a button will update the Silverlight content with cities in the selected country.

Running the project

Figure 1. Running the Project

Understanding the Silverlight .NET Code and XAML

The Silverlight content in Figure 1 uses XAML (in Page.xaml) to define a ListBox item template which contains TextBlocks bound to the name of a city and latitude and longitude values.

<ListBox x:Name="_cities" Cursor="Hand" SelectionChanged="_cities_SelectionChanged">
      	  <StackPanel x:Name="mySP" Orientation="Horizontal">
             <Image Source="pin.png"></Image>
             <TextBlock x:Name="textBlock1"
                	Foreground="Black" Cursor="Hand"
                	FontSize="14" Height="25"
                    Text="{Binding CityName}"></TextBlock>
             <TextBlock Height="0" Text="{Binding Latitude}"></TextBlock>
             <TextBlock Height="0" Text="{Binding Longitude}"></TextBlock>

Note: The Latitude and Longitude values are hidden by specifying the height=0.

The Code-Behind contains a Class that is used to represent Cities, and contains a member element named CityName.

public class CityData
      public string CityName { get; set; }
      public double Latitude{ get;set; }
      public double Longitude{ get;set; }

      public CityData(string cityName, double nLatitude, double nLongitude)
      	CityName = cityName;
            Latitude = nLatitude;
            Longitude = nLongitude;

The _getCities member function will return a List<CityData> containing several cities for a given country. Note: This is hardcoded for demo purposes.

Here’s an example of adding city data for the ‘United Kingdom’.

switch (country)
  case "United Kingdom":
    ret.Add(new CityData("London", 51.5, 0));
    ret.Add(new CityData("Stratford-Upon-Avon", 52.3, -1.71));
    ret.Add(new CityData("Edinburgh", 55.95, -3.16));
. . .

To bind these results to the ListBox, we simply build the List<CityData> and set it to the ItemsSource property of the ListBox. (‘_cities’ is the name of the ListBox)

public void UpdateCities(string country)
  	List<CityData> myCities = _getCities(country);
  	_cities.ItemsSource = myCities;
         . . .

This function is available to .NET code, but how do we expose it to the browser?

Exposing a .NET method to JavaScript

To expose your .NET code to the browser, you will need to:

  1. Reference System.Windows.Browser in your code behind.
  2. Add a Loaded event handler to your page. You can add this in the Page() constructor.
  3. Implement the Page_Loaded event handler, and use it to register your Silverlight control as a scriptable object. In this case we registered the scriptable object (not to be confused with the Silverlight object itself) as MySilverlightObject

The code looks like:

public Page()
      this.Loaded += new RoutedEventHandler(Page_Loaded);
      upDateCities("United Kingdom");

void Page_Loaded(object sender, RoutedEventArgs e)
      HtmlPage.RegisterScriptableObject("MySilverlightObject", this);

Once you’ve done this you can now register your Public methods to be scriptable by using the [ScriptableMember] attribute.

public void UpdateCities(string country)
      List<CityData> myCities = _getCities(country);
      _cities.ItemsSource = myCities;
      . . .

Calling the .NET Method from JavaScript

The first thing you should make sure of is that the Silverlight object has an ID. This is needed so that JavaScript can get a reference to it.

<object data="data:application/x-silverlight,"
           width="300" height="400" id="slControl" VIEWASTEXT>

Now JavaScript can get a reference to your Silverlight control based on this ID:

var slPlugin = document.getElementById("slControl");

To call the .NET based method you then use the syntax:


The JavaScript function called ChangeCountry(country) does this:

function ChangeCountry(country)
      var slPlugin = document.getElementById("slControl");

The HTML Input buttons call this and pass the relevant country.

<input id="bUK" style="width: 100px" type="button"
     value="United Kingdom" onclick="doCities('United Kingdom');" NAME="bUK"/>
<input id="bGermany" style="width: 100px" type="button"
     value="Germany" onclick="doCities('Germany');" NAME="bGermany"/>
<input id="bFrance" style="width: 100px" type="button"
     value="France" onclick="doCities('France');" NAME="bFrance"/>

When the user presses an HTML button, the JavaScript function doCities will execute. This calls the Silverlight scriptable object and passes the parameter to the UpdateCities method in the .NET code for the SilverLight control. The parameter is used to create a List<CityData> of cities for the selected country, which will then be bound to and displayed in the ListBox.

Further Study

In the this section, you saw how to access the .NET code from within JavaScript, but in addition to this you can also manipulate the XAML that Silverlight renders using JavaScript in the browser. Furthermore, Silverlight isn’t restricted to the XAML that is defined as part of the Visual Studio / Blend project. It can be dynamically added and removed at runtime from within JavaScript too!

Here’s some good material for further review:

Calling Browser Script from .NET

Thus far we’ve seen how you can call .NET code from JavaScript within the browser – but what about the other way? The Web ADF has a public JavaScript interface, so instead of building your own Silverlight host for the Web ADF, it’s much easier to have Silverlight call out to the browser and use JavaScript to interact with the Web ADF Map control.

Earlier you saw that pressing HTML buttons that represent different countries will cause cities from those countries to be loaded into the Silverlight content. When you select a city name (in the Silverlight control) it will call a JavaScript function that locates the selected city on the map based on its latitude and longitude.

You can see it in Figure 2.

Locating a selected city

Figure 2. Calling the browser from Silverlight in order to use the Web ADF

Note that the XAML ListBox binds to the CityName, Longitude and Latitude. The latter elements are ‘hidden’ by setting their height value to ‘0’.

Note also that the SelectionChanged Event handler is wired up to the ListBox that contains the TextBlock elements. This means that every time the selection changes, the event will be captured and the values of the selected CityData item can be derived, allowing us to pull the Name, Latitude and Longitude of the current city.

Let’s take a look at this event handler.

private void _cities_SelectionChanged(object sender, SelectionChangedEventArgs e)
     if (_cities.SelectedItem == null)

     CityData cd = _cities.SelectedItem as CityData;
     ScriptObject myScriptMethod =
     myScriptMethod.InvokeSelf(cd.Latitude, cd.Longitude);

Working with the ScriptObject is where the fun begins.

The HtmlPage class allows us to get a reference to a JavaScript function by invoking its Window.GetProperty method and passing it the name of the function. This has to be cast as a ScriptObject in order to be callable:

ScriptObject myScriptMethod = (ScriptObject)HtmlPage.Window.GetProperty("GotoCity");

Now you can call the function using InvokeSelf and pass it the appropriate parameters:

myScriptMethod.InvokeSelf(cd.Latitude, cd.Longitude);

Of course the function GotoCity has to exist on the page, and it has to match the signature that is being used to call it.

Here’s the JavaScript function that takes latitude and longitude and centers and zooms the Web ADF map on these coordinates. Note that Web ADF JavaScript components, which includes the map client control (a scriptable server control), are used to manipulate the map and its contents.

function GotoCity(latitude, longitude) {
      // if map does not exist, get it
      if (map == null)

      // if graphic exists, remove first
      if (graphics)

      // mark location
      var sym = new ESRI.ADF.Graphics.MarkerSymbol("images/pin.png", 16, 32);
      var point = new ESRI.ADF.Geometries.Point(longitude, latitude);
      var feature = new ESRI.ADF.Graphics.GraphicFeature(point, sym);
      graphics = feature;

      // Zoom to Envelope using Lat/Long
      var env =
            new ESRI.ADF.Geometries.Envelope(
            longitude - 0.05, latitude - 0.05,
            longitude + 0.05, latitude + 0.05);
      map.zoomToBox(env, true);

Further study

In addition to calling JavaScript functions, you can also use .NET code to manipulate HTML elements.

Retrieve the HtmlElement using the element name in a call to HtmlPage.Document.GetElementByID(‘elementName’).

Manipulate the element by calling the ‘setAttribute’ method and providing an attribute name and value: element.setAttribute(“attributeName”, value);

Deploying the Silverlight Web Application to your Web Server

Now that you have a built application, you may be wondering what it might take to deploy the ASP.NET application with Silverlight content. Well, there are several ways to deploy the application, all of which are described on the Microsoft ASP.NET and Silverlight Web Sites. Let me describe a couple of them for you.

Pre-compiled Web Site

First, in Visual Studio, you can right-click on the web application project and select the “Publish Web Site” menu item.

Publish Web Site menu item

Figure 3: Publish Web Site Menu item from a right-click context menu

A dialog will appear that will ask some questions and then you’ll click OK to deploy.

Publish Web Site dialog box

Figure 4: Publish Web Site Dialog Box

XCOPY Deployment

Another option is the old copy and paste or XCOPY deployment. Simply copy your web application files (SLADFIntegrationWeb) to the production server hard drive and use Internet Information Services Manager to configure a virtual directory as a Web application.

Final notes

In both cases, you may need to add a MIME type to support the Silverlight content. The following web site discusses those steps in detail:

Other Web Sites to further your study on ASP.NET and Silverlight Deployment options are:

ASP.NET Deployment Overview

Walkthrough: Deploying an ASP.NET Web Application using XCOPY

That’s it! Enjoy!

Contributed by Arthur Haddad of the ArcGIS Server .NET development team

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

Conference proceedings available

The 2008 User Conference proceedings are available:

The proceedings include all professional papers, technical workshop presentations, and GIS & Industry presentations.

Posted in Analysis & Geoprocessing | Tagged | 1 Comment