From your snippets, it looks like you are doing everything right. When
I review the documentation
http://docs.geoserver.org/stable/en/user/styling/sld-extensions/substitution.html
I cannot see what you are doing wrong.
I would run 2 tests:
1. Set the default to something other then 000000 or ffffff, for
instance ff00ff, to make the color distinguishable and to make sure
the default is parsed instead of some system default.
2. Have you tried omitting the default by simply using:
<Fill>
<CssParameter name="fill">
#<ogc:Function name="env">
<ogc:Literal>color</ogc:Literal>
</ogc:Function>
</CssParameter>
</Fill>
And make sure you do not forget the #! as shown here.
2011/5/18 Matt Snider <[email protected]>:
> Hi All,
> I have been using GeoServer to generate tiles over Google Maps. Now I
> require sending a dynamic parameter to the SLD. I have heard that this can
> be done with the ENV parameter
> (http://docs.geoserver.org/stable/en/user/services/wms/vendor.html#env).
> However, I am not sure how to incorporate this into my requests. Currently I
> have been using the following:
> /* Create Map */
> map = new google.maps.Map(document.getElementById('map-canvas'), {
> zoom: 4,
> center: new google.maps.LatLng(38,-97),
> mapTypeId: google.maps.MapTypeId.ROADMAP
> });
> /* Create ImageMapType */
> var imageMapTypeOptions = {
> getTileUrl: function(coord,zoom){
> return
> 'http://localhost:8080/geoserver/gwc/service/gmaps?layers=test:geo_layer&zoom='
> + zoom + '&x=' + coord.x + '&y=' + coord.y +
> '&format=image/png8&env=color_hex:CCCCCC';
> },
> tileSize: new google.maps.Size(256,256),
> opacity:0.7,
> isPng:true
> }
> var tiledImageMap = new google.maps.ImageMapType(imageMapTypeOptions);
> Unfortunately, the color_hex param is not visible in the SLD when I use:
> <ogc:Function name="env">
> <ogc:Literal>color_hex</ogc:Literal>
> <ogc:Literal>000000</ogc:Literal>
> </ogc:Function>
> Instead, it always uses the default value. How can I pass this property
> correctly?
> Thanks!
> Matt
> ------------------------------------------------------------------------------
> What Every C/C++ and Fortran developer Should Know!
> Read this article and learn how Intel has extended the reach of its
> next-generation tools to help Windows* and Linux* C/C++ and Fortran
> developers boost performance applications - including clusters.
> http://p.sf.net/sfu/intel-dev2devmay
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users