<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Use layer.mergeNewParams({TRANSPARENT: true}); instead.<div><br></div><div>Best regards,</div><div>Bart</div><div><br><div>
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Bart van den Eijnden</div><div>Front-end Developer | <a href="http://boundlessgeo.com/">Boundless</a></div><div><a href="http://twitter.com/boundlessgeo">@boundlessgeo</a></div></div>
</div>
<br><div><div>On Oct 12, 2013, at 6:38 PM, Tim Balschmiter <<a href="mailto:tb.rostock@gmail.com">tb.rostock@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi List,<div>i´ve generated a code to add wmc-layer as an Overlay to the map. My code use a file chooser for take a wmc-document. After loading the layers, i can see them on the map and i can see them in the switcher. But the transparency is inaktiv at the beginning, after zooming or dragging the map, the transparency works. How, can I change that is still working with loading the layers?</div>
<div><br></div><div>Here is my examplecode:</div><div>[code]</div><div><div>$('.btn.addWMC').click(function(e) </div><div>    {</div><div>        var fileSelector = $('<input type="file" />').bind('change', function(e)</div>
<div><span class="" style="white-space:pre">            </span>{</div><div><span class="" style="white-space:pre">                  </span>var file = this.files[0];</div><div><span class="" style="white-space:pre">                  </span>var reader = new FileReader();</div>
<div><span class="" style="white-space:pre">                    </span>reader.readAsBinaryString(file);</div><div><span class="" style="white-space:pre">                   </span>reader.onloadend = function() </div><div><span class="" style="white-space:pre">                        </span>{</div>
<div>                extrawmc = reader.result; </div><div><span class="" style="white-space:pre">                              </span>extracontext = format.read(extrawmc,{map:map});</div><div><span class="" style="white-space:pre">                            </span>for (var i=0; i<extracontext.layers.length;i++) </div>
<div><span class="" style="white-space:pre">                            </span>{ </div><div><span class="" style="white-space:pre">                                    </span>var layer = extracontext.layers[i]; </div><div><span class="" style="white-space:pre">                                  </span>layer.params.TRANSPARENT = 'TRUE'; </div>
<div><span class="" style="white-space:pre">                            </span>}</div><div><span class="" style="white-space:pre">                          </span>map.addLayers(extracontext.layers);</div><div>            }</div><div>        });</div><div>        var wmc = fileSelector.click();</div>
<div>        return false;</div><div>    });  </div><div>[/code]</div><div>Thanks for helping me </div><div>Tim</div><div><br></div><br>
</div></div>
_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>http://lists.osgeo.org/mailman/listinfo/openlayers-users</blockquote></div><br></div></body></html>