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