Re: [OpenMap Users] Updating layers when the data change

From: Don Dietrick <dietrick_at_bbn.com>
Date: Fri, 19 Sep 2008 11:56:42 -0400

Hi Chiru,

How do you find out when the data in the database changes?

You can add a Timer to your layer to make periodic calls to the
database and update your OMGraphicList in the layer after consulting
the database.

If your layer extends OMGraphicHandlerLayer, you can override the
prepare() method so it queries the database and constructs the
OMGraphicList to display on the map. You probably want to create a
new OMGraphicList to return from that method, so that your old list
will continue to be used if the map projection changes during the
database fetch. You can have your Timer call doPrepare() on the
layer, which will launch a thread to call prepare(), and then
layer.repaint() will automatically be called for you, updating the map.

Hope this helps,

Don

On Sep 18, 2008, at 11:57 AM, bendi chiranjeevi wrote:

> Hi All,
>
> I am new to Openmap and m using it from past 3 weeks. I have a
> application in which the layers are made by reading data from a
> database. Now, I want that layers to be updated whenever the data in
> the database updates.
>
> I dont want to delete the layer and make a new layer and add it.
> Can anyone give me an example of such updating layers.
>
> Thanks & Regards
> CHIRU
>
>

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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 Sep 19 2008 - 11:59:37 EDT

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