Thanks for your comprehensive reply. Why do you recommend using Vector features over WFS?
I would still have to populate the Vector feature with a call to my WFS server, and the way it looks to me, that could be something of a hassle. I was thinking of what you wrote regardin my document not being correctly parsed, so I tried pasting the output from geoserver that is failing to parse for me, which I can see using firebug, into http://openlayers.org/dev/examples/vector-formats.html and that worked fine. So I'm thinking of folliwing your advice, but wondering is whether I can use Vector layers with a WFS data source consistently. I can of course manually query the WFS server for features, and populate the Vector layer by hand on every map update, but I'm wondering whether the Vector layer can't do that for me instead. Any advice? Kind regards, Gissur -----Original Message----- From: Tim Schaub [mailto:[EMAIL PROTECTED] Sent: 21. febrúar 2008 18:10 To: [email protected] Subject: Re: [OpenLayers-Users] WFS giving me lip Hey- Gissur Þórhallsson wrote: > Hello > > I've been using OpenLayers from some time now and with some success. In my > view it's a great client with amazing potential. > > I've run into a hitch while connecting to a WFS datasource running on > Geoserver. I'm servicing a truckload of OL clients from one machine while the > Geoserver sits on another. In order to bypass the cross-site scripting > restrictions set up by the XMLHttpRequest Object I've set up a serverside > tunneler(written in old skool ASP, don't ask) on the same server as the OL > client that forwards all WFS requests to my geoserver, waits for a response > and writes it back to the client. > > The problem I am having though is that I'm not seeing my WFS features and I'm > getting the following error on loading the WFS layer, and on every subsequent > refresh if I toggle the visibility of the WFS layer using the LayerSwithcer: > > parentnode has no properties > OpenLayers.js (Line 199) > Looks like you're using a single file build, and you're using WFS feature class. You'll have a better time debugging if you run in dev mode - loading all library files instead of the single file build. You'll also be happier in the future if you switch to using vector features instead of WFS features. In OpenLayers.Tile.WFS the requestSuccess calls addResults with what is supposed to be an array of element nodes. These nodes are assembled by the OpenLayers.Ajax.getElementsByTagNameNS method (ack!) which is looking in your parsed doc for nodes named gml:featureMember where gml is an alias for the http://www.opengis.net/gml namespace. There are a few places where things might fail: 1) if your document was not correctly parsed 2) if your gml namespace alias is not "gml" and you're using a browser where getElementsByTagNameNS is not supported (IE) 3) if you're using an incorrect namespace URI for gml I'd say #1 is the most likely. The parsing in this case is the job of OpenLayers.parseXMLString (ack!). If you want to debug farther, don't use a single file build, and use your debugger to step through parseXMLString or put a console log call in there with the result. As an alternative, make your site publicly available and hop on #openlayers to see if you can get help. Tim (All code marked with Ack! is in my mind dangerous and best considered deprecated.) > FireBug tells me the XMLHttpRequest request goes fine, and I can even browse > the XML and everything looks fine. > > Does anybody have any idea what's happening? > > Kind regards, > Gissur > > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.516 / Virus Database: 269.20.9/1290 - Release Date: 20.2.2008 > 20:45 > > _______________________________________________ > Users mailing list > [email protected] > http://openlayers.org/mailman/listinfo/users > > !DSPAM:4033,47bd4f1f263775332866982! > _______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.21.0/1296 - Release Date: 24.2.2008 12:19 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.21.1/1300 - Release Date: 26.2.2008 19:50 _______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
