<HTML><HEAD><TITLE>[Gvsig_english] Draw point without GPS</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6000.17092" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText43274>
<DIV><FONT face="Times New Roman" color=#000000 size=3>Hello, Piotr:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3>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.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3>MapControl mcon = ...get MapControl ...</FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3>MapContext mc = mcon.getMapContext();</FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3>FAcetateLayer ace_lyr = mc.getAcetateLayer();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3>// perhaps you need to do:</FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3>ace_lyr.setVisible(true);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3>// and then:</FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3>Image img = ... some image ...</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3>// you can use MapSymbolIcon or other class that implements IAcetateElement :</FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3>MapSymbolIcon ace_icon = new MapSymbolIcon(img);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3>// these are XY in map units I think (not screen X,Y)</FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3>ace_icon.setXY(.....);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3>// STRING_ID is an invented ID to keep a reference of the element</FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3>ace_lyr.addElement(ace_icon, null, STRING_ID);</FONT></DIV>
<DIV> </DIV>
<DIV>Sorry that this is not properly documented.</DIV>
<DIV>Regards,</DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3></FONT> </DIV>
<DIV> </DIV></DIV>
<DIV id=idSignature24865>
<DIV><FONT face="Courier New" size=2><FONT face="Times New Roman" size=3>Juan Lucas Domínguez Rubio<BR></FONT>---</FONT></DIV>
<DIV><FONT face="Courier New" size=2><FONT face="Courier New" size=2><FONT face="Courier New" size=2>Prodevelop SL, Valencia (España)</FONT></DIV>
<DIV>
<DIV><FONT face="Courier New" size=2>Tlf.: 96.351.06.12 -- Fax: 96.351.09.68<BR></FONT><A href="http://www.prodevelop.es/"><FONT face="Courier New" size=2>http://www.prodevelop.es</FONT></A><BR><FONT face="Courier New" size=2>---</FONT></DIV></FONT></DIV></FONT></DIV>
<DIV><BR>
<HR>
<FONT face=Tahoma size=2><B>De:</B> gvsig_internacional-bounces@listserv.gva.es en nombre de STĘPEL<BR><B>Enviado el:</B> mar 07/12/2010 22:17<BR><B>Para:</B> gvsig_internacional@listserv.gva.es<BR><B>Asunto:</B> [Gvsig_english] Draw point without GPS<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>Hi,<BR><BR>I would like to know, what is the most simple way to implement drawing a<BR>point or any other graphical object on the WMS map, basing on two<BR>specific coordinates? I am a new developer to gvSIG Mobile and I<BR>couldn't find any documentation or description on how the drawing<BR>methods are organised.<BR><BR>I tried to use methods from 'Measure distance' and 'Measure area' tools,<BR>but it didn't work. I think that some attributes must be unblocked.<BR><BR>Best regards,<BR>Piotr<BR>_______________________________________________<BR>Gvsig_internacional mailing list<BR>Gvsig_internacional@listserv.gva.es<BR><A href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</A><BR></FONT></P></DIV></BODY></HTML>