[OpenLayers-Users] problem about display two layers

Christopher Schmidt crschmidt at metacarta.com
Fri May 15 23:04:13 EDT 2009


On Fri, May 15, 2009 at 11:07:01PM +0200, Kris Geusebroek wrote:
> OpenLayers supports IE6 transparency through the alphaHack method.
> 
> layer.alpha = setAlpha('image/png');
> function setAlpha(imageformat)
> {
> 	var filter = false;
> 	if (imageformat.toLowerCase().indexOf("png") > -1) {
> 		filter = OpenLayers.Util.alphaHack(); 
> 	}
> 	return filter;
> }

But the performance is terrible, and will not be usable in any tiled
circumstances. We have deprecated the use of this parameter for that
reason, and I would not encourage anyone to use it without a lot of
testing to be sure it actually works -- in pretty much all situations
I've tested it in, it doesn't. 

-- Chris

> Cheers Kris
> 
> 
> -----Original Message-----
> From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]
> On Behalf Of Christopher Schmidt
> Sent: Friday, May 15, 2009 10:07 PM
> To: Ted Scott
> Cc: users at openlayers.org
> Subject: Re: [OpenLayers-Users] problem about display two layers
> 
> On Fri, May 15, 2009 at 03:50:00PM -0400, Ted Scott wrote:
> > I'm having the same problem with all layers having the transparent:
> true 
> > attribute set. The lower layers are not visible in IE 6. The map
> renders 
> > fine in FFx.
> 
> Yes. 32-bit PNGs (alpha transparency) are not visible in IE6. Use 8-bit
> PNGs or gifs, or don't support IE6. (Microsoft doesn't.)
> 
> -- Chris
> 
> > 
> > Christopher Schmidt wrote:
> > > On Wed, May 13, 2009 at 01:33:22AM -0700, sasi wrote:
> > >> When i display two layers with openlayers, I can only see the
> second layer.
> > >> After i set the second layer opacity=0.5, I can see the both
> layers. But the
> > >> line
> > >> in the second layer seems to be transparent too. And the first
> layers seems 
> > >>  not be very visibility.
> > >> So, can i change only the background to transparent, and keep the
> line to be
> > >> opacity?
> > > 
> > > transparent: true parameter in the WMS params.
> > > 
> > >> The map comes from geoserver.
> > >> Thanks!
> > >> -- 
> > >> View this message in context:
> http://n2.nabble.com/problem-about-display-two-layers-tp2879776p2879776.
> 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
> > > 
> > _______________________________________________
> > Users mailing list
> > Users at openlayers.org
> > http://openlayers.org/mailman/listinfo/users
> 
> -- 
> Christopher Schmidt
> MetaCarta
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users



More information about the Users mailing list