On Wed, Jul 30, 2014 at 10:55 PM, Milo van der Linden <milo@anonymised.com>
wrote:
Hello list,
I noticed that geoserver adds BG=0xFFFFFF to the requests when connecting
to a remote wms service. In my case this is a mapserver service where we
hardcoded the png outputformat to never be transparent and blue so we get
the correct ocean-effect.
Is there a way to bypass the BGCOLOR parameter? Or does this require
enhancements to geoserver itself?
The problem with cascaded wms layers is that they can be used for overlay,
without control on our side.
One way to handle this would be to allow the admin to setup the
transparency flag at the layer definition level.
A probably better approach would be to do that dynamically, and setup the
transparency flag only when the layer
is not the first in the list.
About requests that do specify both bgcolor and transparent=true, the spec
seems to advise that
transparent takes over bgcolor:
When TRANSPARENT is set to TRUE and the FORMAT parameter contains a Picture
format (e.g., image/gif), then a WMS shall return (when permitted by the
requested
format) a result where all of the pixels not representing features or data
values in that
Layer are set to a transparent value. For example, a "roads" layer would be
transparent
wherever no road is shown. When TRANSPARENT is set to FALSE, those pixels
shall
be set to the value of BGCOLOR (Section 7.2.3.10).
Also, setting bgcolor to 0xFFFFFF is the same as not setting it, from the
spec:
The optional BGCOLOR parameter specifies the color to be used as the
background of
the map ...
The default value is 0xFFFFFF
(corresponding to the color white) if this parameter is absent from the
request
Cheers
Andrea
--
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------