[OpenLayers-Users] WFS-Filter refresh layer Problem

fLaNsch at gmx.de fLaNsch at gmx.de
Fri Oct 9 10:11:42 EDT 2009


Hi Users/List,
i've created (Openlayer2.8) a filter-definition and a wfs-layer like :

//FILTER:
var  wfsfilter = '<ogc:Filter xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc">'+'<ogc:OR><ogc:PropertyIsEqualTo><ogc:PropertyName>type</ogc:PropertyName><ogc:Literal>'+one+'</ogc:Literal></ogc:PropertyIsEqualTo><ogc:PropertyIsEqualTo><ogc:PropertyName>type</ogc:PropertyName><ogc:Literal>'+two+'</ogc:Literal></ogc:PropertyIsEqualTo></ogc:OR></ogc:Filter>';

//WFS:
      wfs = new OpenLayers.Layer.WFS(
                "WFS-Tooltip",
                "http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/wfs/wfs.map",
                {typename: 'test', filter: wfsfilter},
                {styleMap: styleMap, extractAttributes:true}
                );  

and it works fine.. 
But now i wanted to change the Filter settings, when a different WMS-Layer change his visibilty. So i created a trigger function like:

//Trigger:
  wms-layer.events.on({ "visibilitychanged": Toggle }); 
  function Toggle(event) {...set different Filter here...}

My problem now is to update/refresh/reload the WFS-Layer with new Filtersettings, so that the correct Features get highlighted and Tooltip is shown. I tried: 
wfs.refresh({force: true});
wfs.mergeNewParams({'bla': Math.random()});
But nothing helps. Any ideas?

Thanks for any help!!
Best regards,
Simon
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



More information about the Users mailing list