Hi Amador
> For this:
> Point screenPoint = evt.getPoint();
> Filter mFilter = mFilterFactory.intersects(
> mFilterFactory.property(mGeomName),
> mFilterFactory.literal(screenPoint));
>
No, that won't work. The first problem is that the Point object there
is not a Geometry (ie. a JTS Point object) but just an ordinary old
java.awt.Point. Secondly, it's giving you the screen position but
what you really want is the map position.
Try this instead...
DirectPosition2D pos = evt.getMapPosition();
GeometryFactory gf = JTSFactoryFinder.getGeometryFactory(null);
Geometry point = gf.createPoint(new Coordinate(pos.x, pos.y));
Filter mFilter = mFilterFactory.intersects(
mFilterFactory.property(mGeomName),
mFilterFactory.literal(point));
Michael
------------------------------------------------------------------------------
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users