Hello Harshad, > Is there a short code snippet available that uses MapMouseEvent for > recording the coordinates of a point which is clicked on a Map. I am facing > issues understanding how the class and its functions work. Please help. >
Basic usage is almost identical to working with standard Java MouseEvents. You write a class which either implements MapMouseListener or extends MapMouseAdapter: http://docs.geotools.org/latest/javadocs/org/geotools/swing/event/MapMouseListener.html http://docs.geotools.org/latest/javadocs/org/geotools/swing/event/MapMouseAdapter.html You then register an instance of your class with your map pane using the addMouseListener method: http://docs.geotools.org/latest/javadocs/org/geotools/swing/MapPane.html#addMouseListener(org.geotools.swing.event.MapMouseListener) Alternatively, the following tutorial shows MapMouseEvents used with a custom CursorTool for clicking on features displayed by a map pane: http://docs.geotools.org/latest/userguide/tutorial/map/style.html Michael ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
