[OpenLayers-Users] Does anybody know what the alphahack is andhow it can be used?

Andreas Hocevar ahocevar at opengeo.org
Thu Oct 8 13:46:15 EDT 2009


If your other layers come from the same wms, you can combine them into
one OpenLayers.Layer.WMS instance, and have alpha opacity on the
resulting image.

Assuming you have layer called base and overlay (the latter has opaque
shapes), and you have

map.addLayers([
    new OpenLayers.Layer.WMS("base", "/geoserver/wms", {layers: "base"});
    new OpenLayers.Layer.WMS("base", "/geoserver/wms", {layers:
"overlay"}, {isBaseLayer: false});
]);

you could change that to

map.addLayers([
    new OpenLayers.Layer.WMS("base", "/geoserver/wms", {layers: ["base",
"overlay"]});
]);

Regards,
Andreas.


Christopher Schmidt wrote:
> On Thu, Oct 08, 2009 at 01:18:06PM -0400, jim.meyer at concept-solutions.com wrote:
>   
>> Hi Christopher,
>>
>>    So. am I correct in assuming that there is no way to have a layer in IE6
>> that has shapes with any opacity?  
>>     
>
> Correct. Though you can make the whole layer partially opaque with the 
> 'opacity' layer option, on the client side: use 8bit pngs, then control the
> client side layer opacity. But it doesn't allow per-shape opacity differences.
>
> Best Regards,
>   


-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.




More information about the Users mailing list