[OpenLayers-Users] WFS Features not displayed

Mehmet Sirin m.sirin07 at googlemail.com
Fri Dec 11 05:33:08 EST 2009


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091211/a6eea044/attachment.html


More information about the Users mailing list