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 (below of
OpenMap.create(propArgs);):
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());
}
I had to put mapPanel like static in order to work ok,
however, the rectangle is not painted on the screen
and I dont know if I'm doing ok or not. Any idea?
Thanks to advance and Best regards
Ruben
______________________________________________
Web Revelación Yahoo! 2007:
Premio Favorita del Público.
http://es.promotions.yahoo.com/revelacion2007/favoritos/
--
[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 Wed Jan 09 2008 - 08:59:32 EST