[OpenMap Users] Could anyone help me to paint a rectangle on the layer?

From: Ruben DF <rdocasalf_at_yahoo.es>
Date: Tue, 12 Feb 2008 16:49:28 +0100 (CET)

Hi to everybody,

I'm a newbie with openmap. I would like to paint a
simple rectangle from openmap.java (from main method)
given the latitude and longitude. My code is:
  
static public void main(String args[]) {
     
        ArgParser ap = new ArgParser("OpenMap");
        String propArgs = null;
        ap.add("properties",
                "A resource, file path or URL to
properties file\n Ex: http://myhost.com/xyz.props or
file:/myhome/abc.pro\n See Java Documentation for
java.net.URL class for more details",
                1);

        ap.parse(args);

        String[] arg = ap.getArgValues("properties");
        if (arg != null) {
            propArgs = arg[0];
        }

        OpenMap.create(propArgs);
        
        //paint rectangle

        float latPointUL = 59.06484f;
        float longPointUL = -100.47563f;
        float latPointBR = -28.030712f;
        float longPointBR = -37.12247f;

        OMRect omRect = new
OMRect(latPointUL,longPointUL,latPointBR,longPointBR,
com.bbn.openmap.omGraphics.OMGraphic.LINETYPE_STRAIGHT);
  
EditableOMRect erect = new EditableOMRect(omRect);
    
erect.generate(mapPanel.getMapBean().getProjection());
    
erect.render(mapPanel.getMapBean().getGraphics());
        
    }

mapPanel had to be changed as a static var and so working ok.
  however, the rectangle is not painted on the screen
and I dont know if I'm doing right or not. Any idea? Could anyone tell me what steps I have to follow to be able to paint the rectangle?

Thanks and best regards,
  Ruben


       
---------------------------------

¿Con Mascota por primera vez? - Sé un mejor Amigo
Entra en Yahoo! Respuestas.
  

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Tue Feb 12 2008 - 10:58:44 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:09 EDT