[Gvsig_english] Draw point without GPS
Piotr Steplewski
stepl at poczta.onet.pl
Thu Dec 9 15:23:13 CET 2010
Hello,
Thank you for reply. Eventually I solved the problem by using similar way of
drawing points and lines to the Measure distance tool. I had only problem
with marking many points at the same time on the map, but the solution was
to use method ShapeFactory.createMultipoint2D(double[], double[]) instead of
ShapeFactory.createPoint2D(double, double).
In future I may use the way, that you cited, because there is possible to
draw any image on the screen, instead of default shapes.
The highlighted fragments of my code:
MapControl mapCtrl = ...get MapControl ...
...
Point2D mp = mapCtrl.getViewPort().toMapPoint(event.getPoint().x,
event.getPoint().y);
addPoint(mp);
...
private void addPoint(Point2D p) {
IGeometry ig = null;
ig = ShapeFactory.createMultipoint2D(listY, listX);
mapCtrl.draw(false);
mapCtrl.setDistanceGeometry(ig, refresh_minx, refresh_miny, refresh_maxx,
refresh_maxy);
}
Best regards,
Piotr Stęplewski
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Draw-point-without-GPS-tp5813274p5818835.html
Sent from the gvSIG international mailing list archive at Nabble.com.
More information about the Gvsig_internacional
mailing list