Java Edition: Example 7


This example shows the use of the Java Edition by both an applet and an application.

To use either the example below or the application, select some features on the map (you may need to zoom in first). The layers of the selected features should appear in the top list. If you select a layer in the list, it should populate the next list with the keys of the selected features on that layer. Then, if you select one of the keys in the list, you will see the name and link values for that feature. If you modify the name or link value of the specified feature, it will be reflected in the map.

Note: The applet portion of this example will not work on Internet Explorer, because IE does not support passing observer objects between JavaScript and Java.

The application portion of this example is already built. To run it as is under Microsoft Windows, you will need the following:

  • A Java Virtual Machine supporting JDK 1.1.5 installed on your machine.
  • Your CLASSPATH environment variable set up to include the standard Java classes.
  • The following files in a single directory:
  • A batch file for running the example on Microsoft Windows or to provide a example for running it on other systems.
  • A zip file containing the classes needed to run the application.
  • A JAR file containing the Java Edition classes.
  • The map below is either the Plug-In or Java Edition under control of the applet portion of this example.

    The complete source for both the applet and application portions of this example is available below:

  • Example7Applet.java
  • Example7Application.java
  • MapInspector.java