Richie's profileThe Sandpit - "We hack s...BlogLists Tools Help

Blog


    August 14

    Silverlight Map Viewer for ArcGIS Server

    During the plenary of the 2008 ESRI International Conference, Ismael Chivite demonstrated a Silverlight map viewer for ArcGIS Server. The source code to the Silverlight map viewer is available here on ESRI Resource Center's code gallery.

    The Silverlight map viewer is a proof of concept developed by the ESRI Prototype Lab.  The viewer is based on the MultiScaleImage control which is also known as DeepZoomDeepZoom is essentially a technology for viewing an image pyramids.  A popular implementation of the DeepZoom technology is the Hard Rock Cafe Memorabilia web page.

    The map viewer is based on Silverlight 2 beta 2 which is cross-browser on both Mac and Windows machines.

    The Silverlight map viewer can be used for any ArcGIS Server cached map service.  However there is one "gotcha".  Due to a limitation with the MultiScaleImage control, tile scales must double sequentially.  For example, if the first tile scale is 1:1000, then the next scale must be 1:2000 then 1:4000 and so on.  The viewer uses the ArcGIS Server REST API to query the map service tile structure.

    Two sample web applications are published on ESRI's website for you to try now.  The first application displays the World 2D Imagery layer from ArcGIS Online.  Click here or the image below to display the web application.

    Silverlight Map Viewer for ArcGIS Server

    The second sample web application demonstration the JavaScript API exposed through the Silverlight map viewer.  Currently there are only a few API's exposed.  View the source code of the following application to understand how to manipulate the Silverlight (e.g. zoom and pan) using JavaScript.

    Sample Silverlight Web Application with JavaScript

    Technorati Tags: ,,
    August 01

    How to develop backward compatible ArcGIS application?

    This post will describe a technique for developing ArcGIS Desktop (or Engine) customizations that are backwardly compatible.

    Let's say you develop a custom toolbar for ArcGIS Desktop on a computer that has ArcGIS Desktop 9.2 sp4 installed.  When that toolbar is deployed to other computers then you may get mixed results.  The toolbar will work on computers with 9.2 sp4, 9.2 sp5, 9.2 sp6 and 9.3 but will barf on computers with 9.0, 9.1, 9.2, 9.2 sp1, 9.2 sp2 and 9.2 sp3.

    Notice that by default all customizations are upwardly compatible.  This is because ESRI installs publisher policy files into the GAC so that assembly references are automatically redirected to the current version.

    The GAC

    But how can you make your toolbar (developed on 9.2 sp4) run on older versions of ArcGIS Desktop?  If you want your toolbar to run on 9.2, 9.2 sp1, 9.2 sp2, 9.2 sp3 then you can:

    1. Compile the toolbar on a computer with 9.2 (no service packs),
    2. Force your project to reference older 9.2 ESRI assemblies.

    Obviously the first option requires you to maintain a historic version of ArcGIS Desktop.  This may be inconvenient and possibly not the most efficient use of a computer.  This problem is magnified if you want to deploy a customization that is compatible with older versions like say 9.0 or 9.1.

    The second option is the best that I have discovered.  After the initial setup, it only requires minor changes to your .NET projects.  Below I will describe the setup needed to create a customization that supports ArcGIS Desktop 9.2, 9.2 sp1-6 and 9.3.

    On any computer:

    1. Install Microsoft .NET 2.0,
    2. Install ArcGIS Desktop 9.2 (do NOT install any service packs),
    3. Copy of the DotNet folder to a location that is accessible to your development computer. Rename the folder to "DotNet92".
      (e.g. copy C:\Program Files\ArcGIS\DotNet to \\ server\files\DotNet92)

    On your development computer:

    1. Copy the 9.2 dotnet folder to your development computer
      (e.g. \\ server\files\DotNet92 to C:\Program Files\ArcGIS\DotNet92)

      The ArcGIS Installation Folder

    In your Microsoft Visual Studio projects:

    1. Open the project that contains references to the ESRI assemblies.  The path name of the assembly reference should point to the DotNet folder in the ArcGIS Installation folder.

       
    2. In the project properties, click the Reference Paths tab.  Click the ellipse button to navigate to and select the new DotNet92 folder (ie C:\Program Files\ArcGIS\DotNet92).  Click the Add Folder button to add the path name to the list of reference paths.


    3. Save the project.  Restart Microsoft Visual Studio and re-open the project.  If you re-examine the reference paths they should now be directed to the new 9.2 (no sp) assemblies in the DotNet92 folder that you copied from another computer.

    The customizations that you developed on this computer are now backwardly compatible to ArcGIS Desktop 9.2 (no sp) and above.  This same technique can be used to create customizations that are backwardly compatible with older versions of ArcGIS Desktop (or Engine) such as 9.0 or 9.1.  Due to assembly changes at 9.0, this technique cannot be used to create customizations that are backwardly computer to pre-9.0 versions like 8.1, 8.2 or 8.3.

    One important considering when compiling against an older assembly is that you cannot take advantage of new features.  For example, if you compile a project against 9.1 assemblies then it can be safely run on computers with 9.2 and 9.3 but you will be unable to use new functionality available in those versions.

    Technorati Tags: ,,