Hi Chris,
On Jan 20, 2004, at 5:15 AM, Chris Riley wrote:
> Hi,
>
> Is there any easy way to add new points to an OMPoly at runtime?
>
> The reason I ask is as follows. I am writing a program which shows the
> track of an object. The first implementation was to draw an OMLine
> object
> each time I recieved a new co-ordinate (using the new and last
> recieved lat
> longs) and add this to an OMGraphicList. However, the more lines in the
> OMGraphicList, the slower the program runs to the point where it
> practically
> locks up.
>
> My solution was to create this line using an OMPoly. However, I cannot
> find
> a way to specify a new point to add to the end of the poly. The only
> solution I can find is to retrieve the array of latlongs, copy it and
> add
> the new points onto the end.
>
> Is there a more efficient way to achieve this?
That's how you'd do it. Be careful, though, the decimal degree values
are replaced in-line with radians. If you just pull the coordinates
and replace them, you'll get weird values since the radians will get
re-converted. You have to pull the lat/lon, use
com.bbn.openmap.proj.ProjMat.arrayRadToDeg and then add add new points.
When you set the points, they will get converted back to radians
automatically.
- Don
-- [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 Tue Jan 20 08:55:40 2004
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:37 EDT