RE: [OpenMap Users] changing buffered shape layer properties

From: Vincent, Chuck <>
Date: Wed, 3 Aug 2005 14:24:37 -0400

I tried your second suggestion, but just calling setProperties() did not
change the map. I came up with the following function that removes all
Componets and then calls shapeLayer.setProperties(), and add(shapeLayer)

public void setMap(int mapId)
        Component[] lComp = getComponents();
        for(int k = 0; k < lComp.length; k++ )
                dataProperties[mapId].put("shapeFile", server_ +

However, this will only work if you changed the projection between
calls. If I call this setMap(1) and then go a pan then setMap(2) map 1
will be removed and map 2 will be drawn. If I do not do the change,
just the blue background of the map will be on the screen UNTIL I
perform a projection change such as a pan or zoom.

Any ideas to what I am doing wrong?


-----Original Message-----
From: Don Dietrick []
Sent: Friday, July 29, 2005 6:16 PM
To: Vincent, Chuck
Subject: Re: [OpenMap Users] changing buffered shape layer properties

Hi Chuck,

On Jul 29, 2005, at 9:21 AM, Vincent, Chuck wrote:

> I need the ability to change the Properties of a BufferedShapeLayer
> and have the MapBean redraw. Particularly, I need that ability to
> change the shapeFile property to reflect different user selected data.

The easiest thing to do is create a new SpatialIndex object with the
new shape file, and then set that on the layer. You'll want to call
setList(getWholeWorld()) on the BufferedShapeLayer, too after
resetting the SpatialIndex property.

You can also set the new file by creating a new set of properties and
calling setProperties on the layer.

> I have tried to create a new BufferedShapeLayer and adding it to
> the MapBean [mapBean.add(myBShapeLayer)] am I missing a command to
> redraw? Do I have to do something special before adding the new
> layer?

No, if it's configured correctly, it should render.

- Don

[To unsubscribe to this list send an email to ""
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Aug 03 2005 - 14:29:13 EDT

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