[OpenLayers-Users] Problems using Layer.WMS.Post

David Alda Fernandez de Lezea dalda at ikt.es
Wed Feb 17 10:47:13 EST 2010


Hello list,

I had som problems applying a SLD to a OpenLayers.Layer.WMS becuase of the mentioned problem of URL length in IE. I followed up the discussions about this solution and decided to apply it to my app. But I get an error when I try to apply an SLD and make it visible. I mean, I create the layer without any error:

olLayers[0] = new OpenLayers.Layer.WMS.Post( "WMSLayer",url,
			{ transparent: 'true', layers: 'RecintosSigpac,ParcelasSigpac,PoligonosSigpac'},{visibility: false, displayInLayerSwitcher:false, isBaseLayer: false, units: 'm', maxExtent: new OpenLayers.Bounds(460000, 4710000, 610000, 4820000), maxResolution: 292.96875} );

Then, later, I have some links that the user can click to apply some SLD's to some parcels. I create the SLD dynamically.

var wms = this.map.getLayersByName("megaWMSLayer")[0];
wms.mergeNewParams({SLD_BODY: sld});
wms.setVisibility(true);

And the problem comes in the line 'wms.setVisibility(true);'. Debugging the error, I found that it crashes in line 1275 character 174 of OpenLayers.js to be precise. This is the code of that line:

tile.onLoadStart=function(){if(this.numLoadingTiles==0){this.events.triggerEvent("loadstart");}
this.numLoadingTiles++;};

And the variable tile is undefined.

Is this a known problem or it's just my fault??.

Any ideas??
 
Thanks in advance.
 
Un saludo,
 
··················································································

David Alda Fernández de Lezea
Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y Biodiversidad
 
IKT
Granja Modelo s/n · 01192 · Arkaute (Araba)

··················································································
Tlfnos.: 945-00-32-95                         Fax: 945-00.32.90
··················································································
email: dalda at ikt.es                                web: www.ikt.es
··················································································



More information about the Users mailing list