[OpenLayers-Users] Probem on OpenLayers WFS
Phil Scadden
p.scadden at gns.cri.nz
Sun Aug 25 15:04:00 PDT 2013
> This statement
> console.log(WFSgeoDBPunti.features);
>
> prints this in the console:
> [ ]
Hmm. This implies features not sent or they are malformed and not parsed
correctly. By way, I strongly recommend that you get used to the
debugging with firebug or chrome tools. Makes investigating this much
easier and you will learn a lot about OL in the process.
On the Net tab of either tool, you will see the POST request that
fetches the features. Look at the response. Is this the GML features
that you posted earlier? Looks valid GML, except that you are requesting
lineStrings, but I only see one point in each feature? Wonder if that is
set up properly at the server end?
> I don't know how to use an event handler beacause I am new in OpenLayers.
Well normally you would be wanting to access features in response to
something that a user does (eg click on the feature - though if you are
using WFS instead of WMS, perhaps you want hover?). This is usually
managed in OL by controls of various sorts, each of which have events
associated with them. You register a handler for the event and you get
the features in context.
eg
http://dev.openlayers.org/releases/OpenLayers-2.13.1/examples/feature-events.html
Notice: This email and any attachments are confidential.
If received in error please destroy and immediately notify us.
Do not copy or disclose the contents.
More information about the Users
mailing list