Re: [Geotools-gt2-users] Real Coordinates

2008-09-08 Thread Michael Bedward
Oops, sorry - that last bit should look more like this... Point2D p = new Point2D.Double(event.getX(), event.getY()); screenToWorld.transform(p, p); Michael > and when handling mouse events... > > Point2D geoCoords = screenToWorld.transform(event.getX(), event.getY())); > -

Re: [Geotools-gt2-users] Real Coordinates

2008-09-08 Thread Michael Bedward
Hi, You can get Geotools to do most of the work for you. One simple approach... // create some tranform objects when your pane is created or resized AffineTransform worldToScreen, screenToWorld; // a transform from geo to window coords worldToScreen = RendererUtilities.worldToScreenTransform(

[Geotools-gt2-users] Real Coordinates

2008-09-08 Thread Edgar Alan Calvillo Moreno
Hi , I need to get the real coordinates in a JMapPane, i'm using the next code: Rectangle bounds = e.getComponent().getBounds(); double x = (double) (e.getX());