Map Content Updates


Purpose
This sample illustrates how to programmatically add and remove content to your map from different sources including shapefiles, shared content, services, KML, raster, and map content files. 
The sample also shows how you can change the drawing order of layers within your map.

How to use

See Using the samples for help on compiling, setting up the debugger, and running the sample. 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.

  1. Open and build the solution in Visual Studio.
  2. Open ArcGIS Explorer, and open a map in which you want to use the sample task.
  3. Select the Add-Ins tab from the ArcGIS Explorer ribbon.
  4. Click the Map Contents CS or Map Contents VB button (depending on which version you are using) to display the dockable window.
  5. Select one of the options to browse for content to add to your map. Each option brings you to a browser dialog for searching for files with the appropriate extension, except for the File GDB option (more on that in the next step). Simply browse to the data you want to add.
  6. If you choose the File GDB option you will get a new dialog. On the new dialog browse to the file geodatabase you wish to open, then click the Find Feature Classes button to get a list of available feature classes in that geodatabase. Choose the feature class you want from the list and click the OK button to add the content to your map.
  7. To remove content from you map, select what you want to remove in the Map Items list and click on the Delete button next to the list.
  8. To change the drawing order of the layers in your map, select the layer to move in the Layer Draw Order list and then use the buttons to the right of the dialog to update.


  9. Map Content Updates dockable window.


Download the files for all languages
DockWindow.cs This file contains the code for adding and removing map content, as well as changing layer drawing order.
frmFileGDB.cs This file contains code for querying a file geodatabase for the available feature classes and allows the user to add a layer to the map.
frmServer.cs This file contains code for querying a map service and a GeoRSS feed.
Download the C# files
DockWindow.vb This file contains the code for adding and removing map content, as well as changing layer drawing order.
frmFileGDB.vb This file contains code for querying a file geodatabase for the available feature classes and allows the user to add a layer to the map.
frmServer.vb This file contains code for querying a map service and a GeoRSS feed.
Download the VB.NET files