Hi,
I created a WMS (mapserver) layer containing 13400 polygons. It loads in 
less then 3 seconds. Good.

I need to develop a tool for the user so he can create a custom query on 
this layer to retreive specific polygons. In a form, the user select the 
parameters and launch the request. Here is the code below. That works, but 
it takes minutes to render. Per example, a query that returns 2482 
polygons, In firebug I see that the query runs in less then 2 seconds.
But, It seems that the creation of the geometries is an heavy task. I get 
this warning in FF


I click on Continue several times and then I get geometries in the map.

I guess 2482 polygons is simply too much for a vector layer. If that is 
the case, is there another format then GeoJson I could use? Maybe my 
approach is totally wrong...

Any comments would be appreciated.
Thanks for your help,
Steve

The code used:

Ext.Ajax.request({
url: 'requeteVulnerabilite.php',
method:'POST',
params: { inddef: cb_inddefValue},
failure: function(){alert("Ca pas marché");},
success: function(result, request )
        {
                //alert(result.responseText);
                vulnerabiliteLayer.destroyFeatures();
                var features = new 
OpenLayers.Format.GeoJSON({'internalProjection':map.baseLayer.projection,'externalProjection':map.baseLayer.projection
                         }).read(result.responseText);
                var bounds;
                if(features) 
                {
                        if(features.constructor != Array) {
                                features = [features];
                        }
                        for(var i=0; i<features.length; ++i) {
                                if (!bounds) {
                                        bounds = 
features[i].geometry.getBounds();
                                } else {
 bounds.extend(features[i].geometry.getBounds());
                                }
                        }
                        vulnerabiliteLayer.addFeatures(features);
                        map.zoomToExtent(bounds);
                }
 
        }
});




Steve Toutant, M. Sc.
Analyste en géomatique
Secteur environnement
Direction de la santé environnementale et de la toxicologie
Institut national de santé publique du Québec
945, avenue Wolfe
Québec, Qc G1V 5B3 
Tél.: (418) 650-5115 #5281
Fax.: (418) 654-3144
steve.tout...@inspq.qc.ca
http://www.inspq.qc.ca
 

<<image/gif>>

_______________________________________________
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users

Reply via email to