Hi,
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.
take a look at our code:
function createWFS(response){
...
var hotel = new OpenLayers.Layer.WFS( "Hotels",
"http://localhost/cgi-bin/mapserv?map=/home/test.map",
{typename: 'hotel'},{extractAttributes:true,
displayInLayerSwitcher:true,
projection:new OpenLayers.Projection("EPSG:4326"),
styleMap: myStyleHotel});
hotel.events.on({
"featureselected": onFeatureSelect,
"featureunselected": onPopupClose
});
// alert(map.getLayersByName("Hotels"));
if (map.getLayersByName("Hotels").length!=0){
map.removeLayer(hotel,false);
}
map.addLayer(hotel);
selectControl = new
OpenLayers.Control.SelectFeature([hotel]);
map.addControl(selectControl);
selectControl.activate();
}
Thank you!
regards
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users