[OpenLayers-Users] KML set transparency

a.lucas at geolnet.net a.lucas at geolnet.net
Fri Jun 21 02:37:57 PDT 2013


Hi,

here is an example of what I have and it works right away:

 var  blue_unit =  new OpenLayers.Layer.Vector("Blue Unit (VIMS)", {
                protocol: new OpenLayers.Protocol.HTTP({
                    url: "Mapping/blue_unit.gml",
                    format: new OpenLayers.Format.GML()
                }),
                strategies: [new OpenLayers.Strategy.Fixed()],
                visibility: true,
                //wrapDateLine: true,
                style: {fillColor: "#0066cc",fillOpacity:0.4 , strokeWidth:
1, strokeColor: "#0066cc", strokeOpacity: 1 },
                projection: map.displayProjection,
            });



i.e., Strokes are opaque but the filling of the polygon is transparent at
60%.

a.




On Fri, Jun 21, 2013 at 11:05 AM, juansre <juansre at gmail.com> wrote:

> Hi.
> I'm having problems setting the transparency for my local kml file.
> This is the code i'm using:
>
> map.addLayer(new OpenLayers.Layer.Vector("comarcas",
> {
> protocol: new OpenLayers.Protocol.HTTP({
> url: "comarcas.kml",
> format: new OpenLayers.Format.KML({
> extractStyles: true,
> extractAttributes: true,
> transparent: true
> })
>
>
> I've also probed with:
> setOpacity: 0.5
>
> But nothing seems to work, and I don't know what i'm doing wrong.
> Thanks for your help!!
>
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/KML-set-transparency-tp5061515.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130621/34a2ecc6/attachment.html>


More information about the Users mailing list