[Gvsig_english] Draw point without GPS

Juan Lucas Dominguez Rubio jldominguez at prodevelop.es
Thu Dec 9 10:28:30 CET 2010


Hello, Piotr:
 
With some code similar to this, you can easily add elements to the map. The FAcetateLayer is used as a transparent layer to add icons, etc. You can place a breakpoint (debug mode) in the draw method of FAcetateLayer to see how it behaves.
 
MapControl mcon = ...get MapControl ...
MapContext mc = mcon.getMapContext();
FAcetateLayer ace_lyr = mc.getAcetateLayer();
 
// perhaps you need to do:
ace_lyr.setVisible(true);
 
// and then:
Image img = ... some image ...
 
// you can use MapSymbolIcon or other class that implements IAcetateElement :
MapSymbolIcon ace_icon = new MapSymbolIcon(img);
 
// these are XY in map units I think (not screen X,Y)
ace_icon.setXY(.....);
 
// STRING_ID is an invented ID to keep a reference of the element
ace_lyr.addElement(ace_icon, null, STRING_ID);
 
Sorry that this is not properly documented.
Regards,
 
 
Juan Lucas Domínguez Rubio
---
Prodevelop SL, Valencia (España)
Tlf.: 96.351.06.12 -- Fax: 96.351.09.68
http://www.prodevelop.es <http://www.prodevelop.es/> 
---

________________________________

De: gvsig_internacional-bounces at listserv.gva.es en nombre de STEPEL
Enviado el: mar 07/12/2010 22:17
Para: gvsig_internacional at listserv.gva.es
Asunto: [Gvsig_english] Draw point without GPS



Hi,

I would like to know, what is the most simple way to implement drawing a
point or any other graphical object on the WMS map, basing on two
specific coordinates? I am a new developer to gvSIG Mobile and I
couldn't find any documentation or description on how the drawing
methods are organised.

I tried to use methods from 'Measure distance' and 'Measure area' tools,
but it didn't work. I think that some attributes must be unblocked.

Best regards,
Piotr
_______________________________________________
Gvsig_internacional mailing list
Gvsig_internacional at listserv.gva.es
http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.gva.es/pipermail/gvsig_internacional/attachments/20101209/1ef74a1f/attachment.htm 


More information about the Gvsig_internacional mailing list