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

Arnd Wippermann arnd.wippermann at web.de
Tue Jul 20 12:24:55 EDT 2010


Hi,

instead {fillColor:"#"+color}, {fillOpacity:a}
You should use
{fillColor:"#"+color, fillOpacity:a}

new OpenLayers.Util.applyDefaults.(arg1, arg2) is the correct use

arg1 and arg2 are something like {property1:value1, property2:value2)

Arnd

-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von ulao
Gesendet: Dienstag, 20. Juli 2010 15:09
An: users at openlayers.org
Betreff: Re: [OpenLayers-Users] change only one attribute in style?


Ok almost there?

this.style = new OpenLayers.Util.applyDefaults( {fillColor:"#"+color},
{fillOpacity:a}, this.style);

then later

this.style = new OpenLayers.Util.applyDefaults( {strokeOpacity:a},
this.style);

This works but using this 

this.style = new OpenLayers.Util.applyDefaults( {strokeColor:"#"+color},
{strokeOpacity:a}, this.style);

turns it all black. The strokeColor seems not to work.
--
View this message in context:
http://osgeo-org.1803224.n2.nabble.com/change-only-one-attribute-in-style-tp
5312670p5316530.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