[OpenLayers-Users] Browser slow performance while parsing OpenLayers.Vector.Feature features : SLDSELECT??

David Alda Fernandez de Lezea dalda at ikt.es
Fri Apr 8 02:25:14 EDT 2011


Phil,

Thanks for your response. We have achieved this in a different way, but I'll have a look to your code.

Regards, 
 
Un saludo,
 
··················································································

David Alda Fernández de Lezea
Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y Biodiversidad
 
IKT
Granja Modelo s/n · 01192 · Arkaute (Araba)

··················································································
Tlfnos.: 945-00-32-95                         Fax: 945-00.32.90
··················································································
email: dalda at ikt.es                                web: www.ikt.es
··················································································

-----Mensaje original-----
De: openlayers-users-bounces at lists.osgeo.org [mailto:openlayers-users-bounces at lists.osgeo.org] En nombre de Phil Scadden
Enviado el: jueves, 07 de abril de 2011 23:36
Para: openlayers-users at lists.osgeo.org
Asunto: Re: [OpenLayers-Users] Browser slow performance whileparsing OpenLayers.Vector.Feature features : SLDSELECT??

So do you HAVE to use WFS? I had a similar problem,

Have a look at http://dev.openlayers.org/releases/OpenLayers-2.10/examples/

The idea is to have the server draw the selected polygons via WMS and have  WFS query return the attribute data.
My code was something like this:

                polySelectControl[i] = new OpenLayers.Control.SLDSelect(OpenLayers.Handler.Polygon,
                          {
                              displayClass: 'olControlSLDSelectPolygon',
                              layers:[layer[i]]
                          });
                  polySelectControl[i].events.register("selected", this, function(e){ // next bit of code selects ONLY the fields to return which are read from a JSON config file. This step reduces the amount of web traffic but more importantly, ensures that geometry is not sent.
                          clearData();
                          var propNames = [];
                          var layerNode = getLayerNode(combo.value);
                          var SpatialQueryNode =layerNode.spatialQuery[0];
                          for (var i = 0; i < SpatialQueryNode.fields.length; i++) {
                              propNames[i] = SpatialQueryNode.fields[i].id;
                          }
// Now set up the wfs to return the attribute data associated with propNames
                          wfsProtocol[combo.value].read({
                             filter: e.filters[0],
                             propertyNames: propNames,
                             callback: processSpatialQuery,
                             scope: strategy
                          });
                  });*/
                  mapPanel.map.addControl(polySelectControl[i]);

All very nice but you need to be aware that geoserver has an unresolved problem with SLD filters. If the WFS layers has different projection to your map projection, then this doesnt work. I understand mapserver doesnt have this problem.
I've worked out an ugly workaround (reproject the polygon before sending the SLD filter) but havent had time to hack the openlayers code to implement it. I dont know what the status of in geoserver is but I am guessing you will get no sense from geoserver developers on new issues till 2.1 is finally out. In short term, I made life a lot easily by generalising the line work but that might be tricky with cadastre.
--
Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St, Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232

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.

_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users


More information about the Users mailing list