Add layer file to map


Purpose
This sample uses the MapBean to display layer files (.lyr). It also shows how to use ArcGIS controls to add and remove layers from the map.

How to use

See How to use ArcGIS samples for help on 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. Run the AddLayerFileToMap application.
  2. Click AddLayer and browse to a feature layer to add to the map (repeat this step as necessary).
  3. Click RemoveLayer and select a layer to remove from the map (repeat this step until no layers are left in the map).


Download the files for Java
mapbean/AddLayerFileToMap.java Main class




Development licensing Deployment licensing
Engine Developer Kit Engine Runtime
ArcView
ArcEditor
ArcInfo