[OpenLayers-Users] RV: Re: Select features from wfs layer

David Alda Fernandez de Lezea dalda at ikt.es
Thu Oct 8 03:46:40 EDT 2009


Hello Rick, thanks for your response and sorry for the lack of information, I didn't know how to start asking. I've seen all WFS related OL examples. For instance, in the example of selecting features from wfs which uses OpenLayers.Protocol.WFS.fromWMSLayer, it doesn't appear to be a good solution for me, because it makes me to have the same layers for WMS and for WFS. So then I tried another way: 
 
var recintosLayer = new OpenLayers.Layer.Vector("WFS",
     {strategies: [new OpenLayers.Strategy.BBOX()],
     protocol: new OpenLayers.Protocol.WFS({
                 url:  "myurl <http://192.168.1.65/cgi-bin/mapserv.exe?map=../htdocs/MFD/ejemplo_wfs.map> ",
                 featureType: "RecintosSigpac",
                 featureNS: "myurl <http://192.168.1.65/cgi-bin/mapserv.exe?map=../htdocs/MFD/ejemplo_wfs.map> ",
                 srsName: "EPSG:23030",
                 version: "1.1.0",     }
 
but, as I have over a million features stored in that table, I try to load the page, but it takes a lot of time and furthermore it never loads the geometries. So I decided not to implement that solution and try another way. Now I'm on my 3rd attempt to solve this problem. 
 
At the moment I'm trying to do the same by using the folowing idea:
 
Using GetFeatureInfo, get the geometry from the x,y clicked by the user. Then add that feature to a vector layer on the fly, and then highlight it on UI. Later it would be perfect if I manage to interact with them. I'm developing it and I think that I'll be able (I hope!!!) to do it in this way, but what I'm wondering is if this is the best way to do things. Is there another easier way to do things?Isn't there an OL function that does what I want to do?
 
Thanks again.
 

________________________________

De: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] En nombre de Rick Wayne
Enviado el: miércoles, 07 de octubre de 2009 17:56
Para: users at openlayers.org
Asunto: [OpenLayers-Users] Re: Select features from wfs layer



	I'd like to develope a functionallity that allows the user to select some of that features (by selecting I mean that I'd would like to have them highlighted) and get some info about them. I've been seaching on the web and I found some ways of doing that, but I don't know if are the correct way of doing things.


Hullo David,

You'll probably have to provide a little more detail. You have examined the "examples" page (http://www.openlayers.org/dev/examples/), right? If you right-click on the map frame and view the frame source, you can look at the ones which do click handlers and provide info about the feature clicked on, using e..g GetFeatureInfo.

rw


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091008/adfbfcea/attachment.html


More information about the Users mailing list