Hi,
I think this is a general problem in search of a canned solution.
How to animate things in Openmap efficiently.
I tried and failed long ago to animate the data in a layer. The best
I could do was to periodically update. I instead hacked my own animation
using a static map just as a demo. But now, two years on, I am feeling
pressure to get a real object tracking solution together. Any examples or
best practices would be most appreciated.
james
On Thu, Sep 05, 2002 at 09:42:13AM -0500 or thereabouts, Shih-Hung Lin wrote:
> I finally have my application up and running. I appreciate Don's hint to make my
> work easy. I, however, couldn't tune up the performance. The real time back end,
> a propitiatory legacy system written in C, provides a set of data through a socket
> every 200 ms in my current design. In other words, my application need to update
> the layer at the rate of 5 Hz to provide satisfactory smooth movement. In two
> simple case experiments, a dynamic object moving around and none at all, the
> method OMGraphicHandlerLayer.repaint() consumes almost all CPU time (I have a Sun
> workstation running at 450 MHz). Did I do anything wrong? Or, is that the nature
> of repaint()?
>
> This is my current setup. The layer is a subclass of OMGraphicHandlerLayer. I
> use a triangle (OMBitmap) with a label (OMText) to represent the location and
> direction for each dynamic object. These two were stored in an OMGraphicList.
> Repaint() is called in every 200 ms to update the layer. Is there any more
> efficient way to achieve the same goal?
>
> -Sunny
>
> Don Dietrick wrote:
>
> > Hi Sunny,
> >
> > You have a number of options here, and most of them involve getting
> > access to the MapHandler. Once you have the MapHandler, you can pretty
> > much get to any component.
> >
> > Using the MapHandler, you can location the LayerHandler, get it's
> > layers, and iterate through them to find your layer.
> >
> > Alternatively, the Layer class has a property, addToBeanContext, that
> > is false by default (layers are isolated from the MapHandler by
> > default). If you set that to true in the properties file, the layer
> > will be added directly to the MapHandler, and you can iterate through
> > the MapHandler objects to find your layer.
> >
> > You could have your back-end create the layer and add it to the
> > MapHandler, where the LayerHandler will pick it up to add it to the map
> > (if it's visible). You wouldn't need to define layer properties for it
> > at all in that case.
> >
> > Lastly, with the next version of OpenMap due out shortly, the
> > com.bbn.openmap.plugin.graphicLoader.GraphicLoader interface has been
> > formally defined as an object that provides OMGraphics on it's own
> > schedule (the graphicLoader package and pilot package have been
> > adjusted accordingly). If a GraphicLoader (which is what your back-end
> > basically is) gets added to the MapHandler (say, by defining it in the
> > openmap.components property or whatever), the LayerHandler has been
> > updated to create a GraphicLoaderPlugIn/PlugInLayer combination to
> > display its graphics.
> >
> > Hope this helps,
> >
> > Don
> >
> > On Wednesday, September 4, 2002, at 11:28 AM, Shih-Hung Lin wrote:
> >
> > > Hi, Group,
> > >
> > > I am new to OpenMap development and wish someone here would help me
> > > with some basics. I am currently working on a new layer with dynamic
> > > objects which reflects the state of a real-time back end. So far I
> > > have those objects static displayed on the layer. I use
> > > "openmap.properties" as following to define the layer and it show up
> > > as I expected.
> > >
> > > openmap.layers=..... dynamic .....
> > > :
> > > :
> > > dynamic.class=com.xyz.layer.DynamicLayer
> > > dynamic.prettyName=Dynamic Objects
> > > :
> > >
> > > In order to move them, I need to grab a reference to the layer. I
> > > wonder if there is a standard way to get references to individual
> > > layers defined in property file.
> > >
> > > -Sunny
> > >
> > >
> >
> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> > 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"]
>
> --
> [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"]
-- [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 Thu Sep 5 14:05:59 2002
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:33 EDT