ArcIMS Add dynamic data


Purpose
This sample demonstrates how to add a dynamic layer to an ArcIMS data source (an image map service) in a Web Application Developer Framework (ADF) application. When working with the ArcIMS implementation of the Web ADF Common application programming interface (API) (the Common API), you can access the ArcIMS API via the MapFunctionality.MapView property. The state of the ArcIMS resource associated with the MapFunctionality is maintained in-session by the Web ADF; any change to the MapView via the ArcIMS API is maintained.
 
This sample shows how to add a dynamic layer to the MapView layer collection for a specific user session without changing the underlying ArcIMS map service. As a result, other users accessing the same ArcIMS map service will not see the dynamic layer.

How to use

Data has been provided for your use with this sample. It can be found at <Your ArcGIS Developer Kit Install directory>/Samples/data/NorthAmerica/rivers.shp.
If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

At design time
  1. Verify that the Web ADF for the .NET Framework is installed and functioning properly. For information on installing and configuring the Web ADF, consult the installation guide.
  2. In Windows Explorer, navigate to <ArcGIS install location>\DeveloperKit10.0\Samples\ServerNet. This folder contains ArcIMS_AddDynamicData CSharp and VBNet folders.
  3. Open the folder of the language you're going to use—CSharp or VBNet—and copy the ArcIMS_AddDynamicData_<language> folder to c:\inetpub\wwwroot. The <language> variable can be either CSharp or VBNet.
  4. Open the IIS Manager from Control Panel > Administrative Tools > Internet Information Services (IIS) Manager or Internet Information Services.
  5. In the console tree view on the left, navigate to Local Computer > Web Sites > Default Web Site, expand Default Web Site, right-click the ArcIMS_AddDynamicData_<language> folder, and click Properties. The Properties dialog box opens.
  6. Click the Directory tab, click the Create button in the Application Settings section, then click OK to close the Properties dialog box.
  7. Start Microsoft Visual Studio 2008 or 2010 and open the ArcIMS_AddDynamicData_<language><vs_version> solution (for example, ArcIMS_AddDynamicData_CSharp2008.sln) located in c:\inetpub\wwwroot\ArcIMS_AddDynamicData_<language>.
  8. In Solution Explorer, right-click Default.aspx and select Set As Start Page.
  9. Open the Default.aspx page in Design view, open the properties window for the MapResourceManager control, and click the ellipsis next to the ResourceItems property. The ResourceItem Collection Editor dialog box opens.
  10. Add or change the MapResourceItem associated with an ArcIMS image map service.
  11. To verify that the ArcIMS image map service has enabled the ability to add dynamic layers to the service, open the map configuration file (.axl) and confirm that the MAP tag has a dynamic attribute set to true. It should appear as follows: < MAP dynamic="true" >
  12. Open the code file (for example, Default.aspx.cs). This sample adds the rivers.shp shapefile that is included with the NorthAmerica sample data located at <ArcGIS install location>\DeveloperKit10.0\Samples\data\NorthAmerica.
  13. Modify the code to change the location of the workspace, name of the shapefile, or type of renderer and symbol. The location of the data must be defined from the perspective of the ArcIMS spatial server, not the Web ADF application.
  14. If necessary, set the run time identity of the Web application by following one of the next two steps. If not necessary, proceed to step 17.
  15. At design time, the identity of the user running Visual Studio is used to connect to an ArcGIS Server local data source. At run time, that identity is established by the Web application. Only one identity can be used to define access to the ArcGIS Server local data sources in a single Web application. This identity can be explicitly defined when building the Web ADF application in Visual Studio by right-clicking the Web project in Solution Explorer and selecting the Add ArcGIS Identity option. Enter the identity credentials that will be used to access ArcGIS Server local resources at run time. This information is added to the web.config file in a standard ASP.NET identity tag. If the Encrypt identity in web.config check box is checked, the identity tag will be encrypted; otherwise, the username and password are stored as clear text.
  16. Open the web.config file, add an <identity> element in <system.web>, set the impersonate attribute to true, and add a username and password attribute and set them to a valid user account. If you're working with ArcGIS Server local data sources, ensure the account has access to the geographic information system (GIS) server resources referenced in the Map control.
  17. Save the project.
  18. In Microsoft Visual Studio 2008, click the Debug drop-down menu, and select Start Debugging.

At run time
  1. Browse to the viewer uniform resource locator (URL) (for example, http://localhost/ArcIMS_AddDynamicData_CSharp).
  2. Click the Add Dynamic Layer button. The dynamic layer is added to the map and table of contents (TOC). When you navigate the map, the Web ADF manages the dynamic layer for you (adds it on every request).

ArcIMS_AddDynamicData_CSharp\Default.aspx User interface for the Web application
ArcIMS_AddDynamicData_CSharp\Default.aspx.cs Code behind the user interface
Download the C# files
ArcIMS_AddDynamicData_VBNet\Default.aspx User interface for the Web application
ArcIMS_AddDynamicData_VBNet\Default.aspx.vb Code behind the user interface
Download the VB.NET files

Download the files for all languages