Hi Tobi,
Add the layers to the LayerHandler instead of to the MapBean, and set
their visibility to be true if you want them to be part of the map.
Using a BufferedMapBean vs. a regular MapBean makes no difference for
pans/zooms, it just helps with repainting the map when the projection
doesn't change. I'd use a BufferedMapBean at least, and a
BufferedLayerMapBean if you are animating an icon over the map (while
setting the background layers in that map bean (layer.setAsBackground
(true)).
- Don
On Aug 22, 2005, at 12:35 PM, Tobias Gorgs wrote:
> Hi,
>
> I have a problem with the BufferedLayerMapBean I can`t solve on my
> own. Perhaps anyone of you can help me.
>
> I have written a kind of moving map application with a
> SimpleBeanLayer and a SimpleBeanObject. Further there are two
> layers (DTED, RPF). Every three seconds the map is repainted with a
> other center point. First I had a MapBean, now a
> BufferedLayerMapBean - but there is no difference in the
> performance of the two. The layers are painted slow and not
> together. Here are parts of my code, have I forgotten something or
> doing something wrong, and how do I have to use the LayerEvent/
> setLayers()-method?
>
> ...
> BufferedLayerMapBean mapBean = new BufferedLayerMapBean();
> MapHandler mapHandler = new MapHandler();
> LayerHandler layerHandler = new LayerHandler();
> MouseDelegator mouseDelegator = new MouseDelegator();
> SelectMouseMode selectMM = new SelectMouseMode();
>
> ...
>
> BufferedLayer bufferedLayer = mapBean.getBufferedLayer();
> bl.addLayer(dtedLayer);
> bl.addLayer(rpfLayer);
> Layer[] layers = {dtedLayer, rpfLayer};
> mapBean.setLayers(new LayerEvent(rpfLayer, LayerEvent.ALL, layers);
> mapBean.setBufferedLayer(bl);
>
> mapHandler.add(mapBean);
> mapHandler.add(layerHandler);
> mapHandler.add(mouseDelegator);
> mapHandler.add(selectMM);
> mapHandler.add(rpfLayer);
> mapHandler.add(dtedLayer);
> mapHandler.add(bufferedLayer);
> ...
>
> Thanks for your time.
>
> Tobi
>
>
>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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 Mon Aug 29 2005 - 10:57:38 EDT