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()));
>
-
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(
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());