// CRS obtained from the ViewportModel
Coordinate world = getContext().pixelToWorld(e.x, e.y);
// now we must transform the coordinate to the CRS of the layer
ILayer layer = getContext().getSelectedLayer();
MathTransform tranform = layer.mapToLayerTransform();
double[] from=new double[]{world.x, world.y};
double[] to = new double[2];
tranform.transform(from, 0, to, 0, 1);