Re: [OpenMap Users] Apply changed OMGraphics

From: Don Dietrick <dietrick_at_bbn.com>
Date: Fri, 6 Apr 2007 23:56:22 -0400

Hi Thomas,

You can all doPrepare() on the layer to make this work, but that
might cause a bunch of extra work to occur - it depends on the number
of OMGraphics your layer has to process in the prepare() method.
doPrepare() causes the prepare() method to be called in a separate
thread.

When you change the location of an OMGraphic, you have to give it the
projection so it can figure out where it's new position on the map
is. This is done by calling omgraphic.generate(Projection). Then,
you call repaint() on the layer. For the default implementations of
doPrepare()/prepare(), all of the OMGraphics are generated with the
current projection, and then a repaint is called. So you can save
yourself the processing of cycling through all of your layer's
OMGraphics if you just call generate on the OMGraphic that was updated.

Hope this helps,

Don

On Mar 28, 2007, at 4:43 PM, oland wrote:

>
> Hi
>
>
> Lepkowski, Thomas wrote:
>>
>> How does an OMGraphic get refreshed on the map? I have a mapBean,
>> mapHandler, layerHandler, and Layer objects all at my Object's
>> disposal.
>> After changing a displayed OMGraphic, I want to apply the changes
>> to the
>> map. My mapBean sits in a plain old JPanel. mapBean.repaint() is
>> not
>> working and mapBean.repaint( theLayer ) is not working. The
>> change is
>> apparent only after zooming in or zooming out. Any ideas?
>>
>
> Try calling doPrepare on the layer after modifying the OMGraphic
>
>
> Lepkowski, Thomas wrote:
>>
>> BTW, what's the official way to search the list archive? Does google
>> crawl the archive?
>>
>
> Try using http://www.nabble.com nabble for searching the OM list
>
> BR
> Carsten
>
>
> --
> View this message in context: http://www.nabble.com/Apply-changed-
> OMGraphics-tf3482281.html#a9722190
> Sent from the OpenMap mailing list archive at Nabble.com.
>
> --
> [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"]



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick_at_bbn.com
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


--
[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 Fri Apr 06 2007 - 23:56:45 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:08 EDT