Monday, January 25, 2010

First program with ArcGIS Engine developer kit

The basic three steps of programming with ArcGIS Engine developer kit for JAVA

1: Initialize the Java Component Object Model (COM).
2: Initialize a valid License. (Need to locate the "Esri license product code" file)
3: Create visual components for the mapviewer.

It loads a .mxd file in 'Mapbean' (created using java bean) which is a class from ArcObjects library. And the 'loadMxFile' method of this class loads the entire data and represents a graphical view or map in a JFrame.

There are sample data folder given inside /java/samples/data/mxds/ directory. I tested world.mxd. It works fine showing the whole world map.

1 comment:

  1. This looks like good progress. Now the challenge is to find how to get notified of mouse coordinates and, especially, how to determine what geographic object the mouse is over. Is it possible that the ArcObjects layer provides some relevant functionality that the ArcEngine layer does not provide?

    In the worst case, we could build a separate data structure recording all the shapes on the map, and use that for determining what object the mouse is over. We would need to *either* map the cursor coordinates into world coordinates, or else that data structure would have to be transformed to record screen coordinates. The algorithms and data structures for this are fairly well-known, but they are not trivial, so it would be a big advantage if ArcObjects already provides that functionality.

    ReplyDelete