Monday, February 15, 2010

Indentify map cpmponent with mouse move

Now the identify method can determine the name of a map component while clicking. The next task is to add this functionality with mouse move. So I add another event handler mouseMotionListener with the Mapcontrol. Whenever the mouse pointer is moved it invokes the same identify method to determine where the pointer is right now.

As the mouse move event is more frequent than mouse click, the audio seems slower. So for now I stopped the audio response.

Tuesday, February 9, 2010

Incorporating sound with map component

Opening a new window on click will not be an efficient way of mouse move event. So I changed the way of showing information table of the 'identify' toolbar control. Right now we are interested only with determining the place name. So, now if the mouse has been clicked some where inside 'Oregon', only the text 'Oregon' is printed out in the console panel. Thus the mouse pointer identifies where it is pointing right now.

The next step is to incorporate sound with mouse event. I used java 'com.sun.speech.freetts' libraries to incorporate sound. This is a free 'Text to speech' library. Right now if the mouse has been clicked somewhere in 'Oregon', the speaker also enunciate the word 'Oregon'!!!

OnMouseMove and toolbar control 'identify'

ArcGIS engine library provides us with the event handler OnMouseMove that deals with mouse motion listener. Now I can extract the mapX and mapY of the point where the mouse has been moved.

The ArcGIS engine divides the Jpanel into three beans:
1. Topmost: toolbar
2. Leftmost: Table of Contents (TOC bean)
3. other: Map View.

I found an important toolbar control 'identify'. If this control is active and I click on any point on the Map view, it opens a new window. The new window contains a table of information related with the map-point as extracted from the .mxd file. The view of these information can be customized by selecting either "All layer" or "Top-most Layer".

Suppose if the mouse has been clicked on somewhere inside 'California' of the US map, the table shows State_name, population, area, households etc. of CA.