Re: [OpenMap Users] Improve performance when dynamic layers are repainted

From: Don Dietrick <dfdietrick_at_gmail.com>
Date: Fri, 16 Jul 2010 13:57:19 -0400

Hi Ruben,

The first thing I would do is drop the refresh rate to make them happen further apart than 100ms. Think about what you are trying to display on the map, what is changing and how far they actually move every 100ms. You might need that fast of a turnaround, but you might not, too.

Secondly, if you know that you constantly need the map refreshed, stop calling repaint from the layer and have a separate component call repaint on the MapBean itself, on whatever interval you choose. It's better to have a regular, simple update mechanism controlled by a single source - that way the awt queueing mechanism doesn't have to work to make sure all requests are handled. The threads driving the layer updates should just prepare and generate the OMGraphicLists on the layers, and the layers simply paint whatever is there when the paint call comes through.

Hope this helps,

Don


On Jul 16, 2010, at 8:07 AM, Ruben DF wrote:

> Hi,
>
> I'm writing you because I have a huge performance problem when I repaint several dynamic layers each 100 milliseconds.
>
> I have static layers (which are defined in openmap.property) and dynamic layers which are defined in execution time. These dynamic layers contains a series of OMGraphics such as lines, polylines...etcetera.
>
> The process to repaint (each 100 milliseconds) that I'm using is (after adding/modifing elements to omGraphicList):
>
> omGraphicList = layer.prepare();
> layer.setList(omGraphicList);
> layer.repaint();
>
> I don't know if I'm repainting in the best way (for example, i dont know if I could paint only the elements which have changed its location), but when I call repaint, the map goes slowly (zoom, pan...etc)
>
> I'm using a MapBean (not BufferedMapBean), does it affect to the performance? (I have to say that I have no problem with static layers)
>
> Anybody can help me?
>
> Thanks in advance
> Regards
>

--
[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 Jul 16 2010 - 13:58:03 EDT

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