[OpenLayers-Dev] WMS should default to GIF instead of JPG
Bart van den Eijnden (OSGIS)
bartvde at osgis.nl
Wed Nov 22 03:42:57 EST 2006
I ran into the same issue as well a while back and it took me more than half
an hour to figure it out ....
Is it not an option to:
1) if a WMS layer is a baselayer, have it default to JPEG?
2) if a WMS layer is not a baselayer, have it default to GIF and have
transparent default to true?
That would make the most sense in my opinion conceptually, but I don't know
how difficult this would be to achieve.
Best regards,
Bart
--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl
--------- Oorspronkelijk bericht --------
Van: Cameron Shorter <cameron.shorter at gmail.com>
Naar: Tim Schaub <noreply at geocartic.com>
Cc: 'openlayers' <dev at openlayers.org>
Onderwerp: Re: [OpenLayers-Dev] WMS should default to GIF instead of JPG
Datum: 22/11/06 03:28
> I should add,
> What triggered this suggestion is a query on the IRC:
>
> "I've set transparent=TRUE, but the WMS layers are still not
> transparent. Why?"
>
> I knew the answer because I had been stuck on the same problem. The
> images were defaulting to JPG instead of GIF.
>
> Tim Schaub wrote:
> >>For WMS layers, which are usually placed over a photo basemap
> >>like GoogleMaps?, GIF is a better format. GIF is lossless and
> >>works best for images with a fixed number of colors (as is
> >>usually returned by WMS layers). GIF allows transparency.
> >
> >
> > I don't know if it's true that WMS layers are used as overlays more
often
> > than basemaps.
> >
> > To get a WMS layer to behave as an overlay, you have to send it
either the
> > isBaseLayer:false option or the transparent:'true' parameter. As
long as
> > you're constructing your WMS overlay with one of these, it doesn't
seem like
> > too much of a hassle to add format: 'image/gif' or format:'image/png'
and
> > transparent:'true'.
> >
> >
> >>And for the record, PNG has similar properties to GIF, but
> >>older versions of IE have problems rendering PNG layers, so
> >>is not a suggested format.
> >
> >
> > Actually, regular old transparency in PNG is supported in the most
common IE
> > setup (IE6 on Windows). It is alpha transparency in 24 bit PNG that
is a
> > headache in pre-IE7 (this is for partially transparent pixels instead
of a
> > single color indexed as transparent).
> >
> > Also, not all WMS servers will give you a GIF with transparency just
by
> > asking for GIF. Compare these two images (first one GIF without a
> > transparent background, second one PNG that does give you
transparency).
> >
> > (GIF that doesn't have a transparent background)
> >
http://maps.customweather.com/image?LAYERS=earthquakes&FORMAT=image%2Fgif&TR
> >
ANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=a
> >
pplication%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-180%2C-90%2C180%2C270&
> > WIDTH=256&HEIGHT=256
> >
> > (PNG that does have a transparent background)
> >
http://maps.customweather.com/image?LAYERS=earthquakes&FORMAT=image%2Fpng&TR
> >
ANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=a
> >
pplication%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-180%2C-90%2C180%2C270&
> > WIDTH=256&HEIGHT=256
> >
> > Note that this site is serving up PNG with alpha transparency (32
bit), so
> > this is a problem for IE. The point is that just because you ask for
a GIF,
> > you may not get a transparent background.
> >
> >
> >>So I suggest that the default format offered by the
> >>Openlayers WMS is GIF format instead of JPG as is currently the
case.
> >
> >
> > Whether GIF or JPEG is the default doesn't make much difference to
me.
> > Since transparent is not 'true' by default (in the WMS.js
parameters), I
> > think your best off if you're explicit about asking for what you
want.
> >
> > Tim
> >
> >
> >>--
> >>Cameron Shorter
> >>http://cameron.shorter.net
> >>_______________________________________________
> >>Dev mailing list
> >>Dev at openlayers.org
> >>http://openlayers.org/mailman/listinfo/dev
> >>
> >
> >
> > _______________________________________________
> > Dev mailing list
> > Dev at openlayers.org
> > http://openlayers.org/mailman/listinfo/dev
> >
>
>
> --
> Cameron Shorter
> http://cameron.shorter.net
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>
>
More information about the Dev
mailing list