On Wed, May 18, 2011 at 7:57 PM, Matt Snider <[email protected]>wrote:

> 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?
>
>
As far as I know that parameter works if you make WMS requests to GeoServer,
but
I have no idea what might happen if you make requests to GWC instead.
My guess is that GWC is not passing down the parameter into the WMS request
when
first building the tile cache

Using pareter substitution with a tile cache also makes me wonder about the
odd combination:
the parameters are likely to change often no? That defeats the purpose of
having a cache or,
if managed, requires having multiple caches, one for each possible value of
that parameter.

Cheers
Andrea


-- 
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------
------------------------------------------------------------------------------
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

Reply via email to