MapMouseEvent extends MouseEvent { public DirectPosition2D getWorldPos() { return new DirectPosition2D( worldCoords.getCoordinateReferenceSystem(), worldCoords.x, worldCoords.y); } MapMouseEvent(MapPane pane, MouseEvent event);  MapMouseEvent(MapPane pane, MouseWheelEvent event); @Override MapPane getSource(); boolean isWheelEvent(); int getWheelAmount(); DirectPosition2D getMapPosition(); DirectPosition2D getWorldPos(); ReferencedEnvelope getEnvelopeByWorld(double widthWorld); ReferencedEnvelope getEnvelopeByPixels(double widthPixels);  }
@Test public void getWorldPos() throws Exception { AffineTransform tr = pane.getMapContent().getViewport().getScreenToWorld(); Point2D p = new Point2D.Double(x, y); tr.transform(p, p); createEvent(x, y); DirectPosition2D pos = mapEv.getWorldPos(); assertEquals(p.getX(), pos.x, TOL); assertEquals(p.getY(), pos.y, TOL); }