[OpenLayers-Users] change only one attribute in style?

Arnd Wippermann arnd.wippermann at web.de
Mon Jul 19 13:02:26 EDT 2010


Hi,

To change only some properties without repeating all others you can use

polygonFeature.style = new OpenLayers.Util.applyDefaults({pointRadius:20},
polygonFeature.style); 

Arnd



-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von ulao
Gesendet: Montag, 19. Juli 2010 18:00
An: users at openlayers.org
Betreff: [OpenLayers-Users] change only one attribute in style?


ok This does not make sense to me, and I hope its just me and not by
design...

I do somthing like this
			polygonFeature.style = {
                    pointRadius: "${type}", // sized according to type
attribute
                    fillColor: "#0000ff",
                    strokeColor: "#ff9933",
                    strokeWidth: 2,
                    graphicZIndex: 1
            };

and I can sent my color . but Doing this.

			polygonFeature.style = {
                    pointRadius: "${type}", // sized according to type
attribute
                    fillColor: "#0000ff",
//strokeColor: "#ff9933",
                    strokeWidth: 2,
                    graphicZIndex: 1
            };

will set the stroke to black. So its like I have to set all attributes each
time. Is there a way to just set one attribute, am I miss-using this?




--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/change-only-one-attribute-in-style-tp
5312670p5312670.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list