Hi List,
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?
Here is my examplecode:
[code]
$('.btn.addWMC').click(function(e)
{
var fileSelector = $('<input type="file" />').bind('change',
function(e)
{
var file = this.files[0];
var reader = new FileReader();
reader.readAsBinaryString(file);
reader.onloadend = function()
{
extrawmc = reader.result;
extracontext = format.read(extrawmc,{map:map});
for (var i=0; i<extracontext.layers.length;i++)
{
var layer = extracontext.layers[i];
layer.params.TRANSPARENT = 'TRUE';
}
map.addLayers(extracontext.layers);
}
});
var wmc = fileSelector.click();
return false;
});
[/code]
Thanks for helping me
Tim
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users