Re: Plotting...

From: Don Dietrick <dietrick@bbn.com>
Date: Fri Mar 29 2002 - 09:46:01 EST

Hi Erik,

On Thursday, March 28, 2002, at 03:11 PM, Oscarson Erik wrote:

> Hello,
>
>  
>
> I’m attempting to plot circles that are centered on a set of lat/lon
> points.  I want the radius to always be constant, say 10 pixels,
> regardless of map scale.   

I'd use an OMPoint object, and set it to oval with a radius of 10.

In general, there are three types of OMGraphics - those that are
rendered in lat/lon space, those that are rendered in screen x/y pixel
space, and those that are rendered in screen x/y pixel space but tied to
a lat/lon.

>
> Is there an easy method to get the X/Y screen location for a given
> lat/lon point?  
>

The Projection object delivered to the layer in the projectionChanged()
method, inside the ProjectionEvent has forward() methods for going from
lat/lon to x/y, and inverse() methods for going from x/y to lat/lon.

> Assuming I can get the X/Y point(s), I’m still a little confused about
> getting the graphics object vs. using OMGraphics.

OMGraphic is a historical name - it's an map object that is getting
painted to the map. It's not at all like a java.awt.Graphics object.

Once you tell the OMGraphic where it is, you call
OMGraphic.generate(Projection);

to let it figure out where it should go on the map, and then at some
point, like in the Layer.paint() method, you

OMGraphic.render(java.awt.Graphics);

so it paints itself in a java.awt.Graphics object. The other OpenMap
layers demonstrate OMGraphic management (i.e. DemoLayer).

Hope this helps,

Don

> Any help is appreciated.
>
>  
>
> Erik Oscarson
>
> Raytheon
>
> (703)923-2282
>
> eoscarson@rayva.org
>
>  
>
>

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, BBN Technologies, dietrick@bbn.com
10 Moulton Street, Cambridge, MA 02138
617-873-3031 [fax]-2794
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Mar 29 10:37:02 2002

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:32 EDT