And the winners are…

March 21, 2007

The winners of the ArcGIS Server Code Challenge were announced this morning at the ESRI Developer Summit in Palm Springs, California.

First Place

Winner of a Trimble Recon GPS XB Edition  Bundled with ArcPad

Hussein Al-Sayegh, Khatib & Alami, Manama, Bahrain
Sample AJAX TOC

Second Place

Winner of a Microsoft Xbox 360

Ranjit Menon, Telvent Miner & Miner, Fort Collins, Colorado
Persisting and Retrieving Data Using Server Object Extension

 

Third Place

Winner of a Microsoft Zune

Sasa Ivetic , Map It Out, Inc., Winnipeg, Canada
A Control Used to Set the Scale on the Map

 

Honorable Mention

John Waterman,  GCS Research, East Burke, Vermont
SOA Example: ArcGIS Explorer and ArcMap Clients


Sample AJAX TOC

March 1, 2007

By Hussein AlSayegh, GIS Application Developer, Manama, Bahrain

Orange ArrowDownload the script.

Code Summary

Using ArcGIS server, we have developed an entire system using AJAX technology. Since ArcGIS server web contents refershes the whole page whenever any action is taken. We have developed from scratch all tools (zoomin, zoom out, identify and other functions using simple HTML /Javascripts controls only)

The most difficult part was the creating of the TOC using Ajax.

This project contains a sample code of how to generate the table of content with the symbols in HTML format

To run the project you need to set impersonation in the Web.config

hhhh = hostname
xxxx = username
pppp = password

example

in the QueryAjax.aspx

you have to set the following variables

———— Here you put your parameters to create the map —————
Private Const m_sServerName As String = “master”
Private Const m_sServerObject As String = “allds”
Private Const m_sDataFrame As String = “layers”


Persisting and Retrieving Data Using Server Object Extension

February 28, 2007

By Ranjit Menon Ravi Jayaraman, Senior Analyst, Fort Collins, CO

Download the script.

Code Summary

This code presents a strategy that would allow serializable objects to be shared between ArcGIS Server users. This application provides a way for multiple users to make updates to an ArcGIS Server website and for all users to see those changes immediately. An example of a practical application of this technology would be for sharing information between field crews that work for a utility company. A crew member can share field notes or drawings created in the field with their supervisor or even another field crew.

The tool makes use of the ArcGIS Server extension to serialize and store graphic elements and text. The only graphic element currently implemented is a polyline, however the code can be easily extended to any serializable element, such as text, points or polygons. The text is typed into a text box and when the user clicks the “Send” button, it gets saved on the server.

The graphic elements and text are saved in files on a common shared file location on the server. This allows the elements to be retrieved even if the server objects are recycled or the server is restarted. This application works with both a pooled and non-pooled server objects, so it can accommodate a number of ArcGIS Server implementation strategies.

See “ArcGIS_Server_App_Readme.doc” included in the zip file for more information.


Point Buffer Code for Web Map Application

February 28, 2007

By Craig Unrein, Lead Software Developer, Laramie, WY

Orange ArrowDownload the script.

Code Summary

This creates a simple visual buffer on a point for a web map application. It is simple and currently only works for points in lat/log and the buffer diameter is specified in feet.


Custom Data Source Using Standard SQL Database

February 28, 2007

By Craig Unrein, Lead Software Developer, Laramie, WY

Orange ArrowDownload the script.

Code Summary

This is an example of how to create a simple custom data source that access a SQL 2005 database table w/ geographic point data and plot it on a map. It also implements the query interface so that Identify and Query work as well.


FeatureSearchTask Control

February 28, 2007

By Stan Harrison, Lead Developer, Richmond, VA

Download the script.

Code Summary

The FeatureSearchTask Control is a custom Task that can be added to the TaskManager. This control creates a DropDownList that contains all the searchable layers. When the user selects a layer, a list of all the fields will be displayed to the user with an adjacent TextBox. A data type validation control will be associated with the TextBox if the field type is numeric or date. If the field is a domain then a DropDownList control will be used instead of the TextBox. The DropDownList will be populated with either the coded values or the names of the domain values.

The control is compiled into a DLL. The JavaScript file for the control is embedded in the DLL. Included is a test asp.net page that demonstrates how to the use the control.

To use the control:
1) Copy the DLL to the bin directory of your project.
2) Register the control with your ASPX page.

3) Add the control tag to the TaskManager Control on your page


SOA Example: ArcGIS Explorer and ArcMap Clients

February 28, 2007

By John Waterman, Director of Geospatial Services, East Burke, VT

Orange ArrowDownload the script.

Code Summary

This sample demonstrates a simple Service-Oriented Architecture (SOA) for exposing buffering functionality to different client applications based on a centralized geodatabase server via ArcGIS Server. Client applications include ArcMap and ArcGIS Explorer. Images contained in the README file illustrate this sample and how the same architecture could be extended to other clients, i.e. mobile and web.


Select Toc nodes with TOC Control

February 28, 2007

By Joey Gentry, GIS Programmer, Moscow, ID

Orange ArrowDownload the script.

Code Summary

This little bit of code is an event that the toc control contains. This allows you to select layers by clicking them on the toc. This works because toc controls inherit treeviewplus. Just make sure you add the event to your default class and add the selectedcolor attribute to the toc in the asp code.


Export Attributes to CSV/Excel

February 26, 2007

By Ariz Naqvi, GIS Administrator, Union City, CA

Download the script.

Code Summary

This sample ArcGIS Server web application includes a simple functionality to export feature attributes as a CSV file that can be opened with Excel.

User can select a layer whose attributes are to be exported. All attributes (subject to a max) for layer features in the current map extent will be exported. If the selected layer is not visible, the map scale will be changed to the nearest visible scale(min or max).

The MaxRecords returned are set to 1000. The MaxRecords property can be changed in the script. However, if the ArcGIS map service configuration file has a lower MaxRecords limit then that will be take precedence.

Also, a large number of attribute information will take longer to generate.

Before using the application, configure the ArcGIS Identity & set the MapResourceItem for the MapResource Manager.


Available Map Services TreeView Control

February 23, 2007

By Stan Harrison, Lead Developer, Richmond, VA

Download the script.

Code Summary

This is a custom control that will list all the map services on a given ArcGIS Server. It uses a TreeView control to display the services very similar to how they are seen in ArcCatalog. When a user selects a service, the control will remove all existing map resources from the MapResourceManager associated with the Map control. Then it will add the new service to the MapResourceManager.

The control is compiled into a DLL. All images for the TreeView are embedded in the DLL. Included is a sample asp.net page that demonstrates how to the use the control.

To use the control:
1) Copy the DLL to the bin directory of your project.
2) Register the control with your ASPX page.

3) Add the control tag to the page

One thing to note about the control, it does not use a postback or a callback. Instead it does a page redirect back to itself. This is done to simplify synchronizing the TOC and OverviewMap with the new service.