[OpenLayers-Users] OpenLayers and Tilecache doesn't work with "mergeNewParams" Parameter

Rahn Hanno (rahn) rahn at zhaw.ch
Mon Oct 12 03:38:11 EDT 2009


Hello list,

 

I still have a problem with my TileCache configuration. I try something out but it doesn't work. I think it is a problem with the mergeNewParams Parameter in OpenLayers. All other layers work but the layer with the mergeNewParams doesn't. As new Param I get a php-Skript which generates an SLD-File for styling the map. I hope you can help me again. Without TileCache all works fine. And all layers without the mergeNewParams works, too. With the mergeNewParams Parameter I only get white Tiles without any error message. At the Server there are white png-files in the output Directory from Tilecache.

 

Here are my code fragments. Perhaps you can see the error. I think my resolutions and my extents are ok.

 

Tilecache.cfg

 

[gemeinden_2008]

type=WMS

url=http://webgis.hsw.ch/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/GINES/Maps/Gemeinden_Bern.map

#mapfile=C:/ms4w/Apache/htdocs/GINES/Maps/Gemeinden_Bern.map

layers=gemeinden_2008

maxresolution=481.8359375

minresolution=0.0009190291166305542

resolutions=481.8359375, 240.91796875, 120.458984375, 60.2294921875, 30.11474609375, 15.057373046875, 7.5286865234375, 3.76434326171875, 1.882171630859375, 0.9410858154296875, 0.47054290771484375, 0.23527145385742188, 0.11763572692871094, 0.058817863464355469, 0.029408931732177734, 0.014704465866088867, 0.0073522329330444336, 0.0036761164665222168, 0.0018380582332611084, 0.0009190291166305542

levels=5

extension=png

extent_type=loose

srs=EPSG:21781

bbox=555100,129900,678450,245000

metaTile=true

 

OpenLayers

 

var url = "http://webgis.hsw.ch/GINES/Styling/mysld_bezirke.php?";

var urlFusion = "http://webgis.hsw.ch/GINES/Styling/mysld_fusion.php?";

var urlArray = ["http://webgis.hsw.ch/cgi-bin/mapserv.exe?", "http://195.176.253.211/cgi-bin/mapserv.exe?"];

var urlArrayTC = ["http://webgis.hsw.ch/cgi-bin/tilecache/tilecache.cgi?"];

var mapFile = "../htdocs/GINES/Maps/Gemeinden_Bern.map";

 

var options1 = {

            maxExtent: new OpenLayers.Bounds(555100,129900,678450,245000),

            maxScale: '500',

            minScale: '458262',

            resolutions:[481.8359375, 240.91796875, 120.458984375, 60.2294921875, 30.11474609375, 15.057373046875, 7.5286865234375, 3.76434326171875, 1.882171630859375, 0.9410858154296875, 0.47054290771484375, 0.23527145385742188, 0.11763572692871094, 0.058817863464355469, 0.029408931732177734, 0.014704465866088867, 0.0073522329330444336, 0.0036761164665222168, 0.0018380582332611084, 0.0009190291166305542],

            maxresolution:481.8359375,

            minresolution:0.0009190291166305542,

            units: 'm',

            projection: "EPSG:21781",

            controls: []

};

 

var map = new OpenLayers.Map('map',options1);

 

var wms = new OpenLayers.Layer.WMS("Gemeinden",urlArrayTC, {map:mapFile,layers:layerName,format:"image/png",EXCEPTIONS:"application/vnd.ogc.se_inimage"} );

 

var sld_string=url+"jahr="+jahr+"&indikator="+indikator1+"&klassen="+klassen+"&vis="+vis+"&fusion="+jahr4+"&farbe="+farbe;

 

wms.mergeNewParams({ SLD:sld_string});

 

Greetings

Hanno Rahn

 

------------------------------------------

Hanno Rahn, Dipl.-Ing. (FH) Geoinformatik

ZHAW Zürcher Hochschule für Angewandte Wissenschaften Umwelt und Natürliche Ressourcen 

Fachstelle Geoinformatik 

Grüental, Postfach CH-8820 Wädenswil 

Tel +41 (0)58 934 5592

Fax +41 (0)58 934 5580 

hanno.rahn at zhaw.ch 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091012/90f80ce7/attachment.html


More information about the Users mailing list