Hi,<br><br>does anybody know why requested wfs features are not displayed after removing and re-adding them by recalling the function? They only appear after changing the zoom level.<br><br>take a look at our code:<br><br>
function createWFS(response){ <br> ...<br> <br> var hotel = new OpenLayers.Layer.WFS( "Hotels",<br> "<a href="http://localhost/cgi-bin/mapserv?map=/home/test.map">http://localhost/cgi-bin/mapserv?map=/home/test.map</a>",<br>
{typename: 'hotel'},{extractAttributes:true, displayInLayerSwitcher:true, <br> projection:new OpenLayers.Projection("EPSG:4326"), styleMap: myStyleHotel}); <br> <br>
hotel.events.on({<br> "featureselected": onFeatureSelect,<br> "featureunselected": onPopupClose<br> }); <br> <br>
// alert(map.getLayersByName("Hotels"));<br> <br> if (map.getLayersByName("Hotels").length!=0){<br> map.removeLayer(hotel,false);<br>
} <br> <br> map.addLayer(hotel); <br><br> selectControl = new OpenLayers.Control.SelectFeature([hotel]); <br> map.addControl(selectControl);<br>
selectControl.activate(); <br> <br> <br> }<br><br>Thank you!<br>regards <br><br><br><br>