Hi, I think you get the message because you have 1700features which is big. How about using Strategy.BBox() or something similar to reduce it?
regards Sarah ________________________________ Von: Joaquín Rodriguez-Guerra Urcelay <[email protected]> An: "[email protected]" <[email protected]> Gesendet: Montag, den 4. Oktober 2010, 13:35:11 Uhr Betreff: RE: [OpenLayers-Users] Question about Filtering Features in a Vector Layer Hi, Finally I added the 1700 features like this: .... featuresAll.push(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(<bean:write name="item" property="lon"/>, <bean:write name="item" property="lat"/>), { id: asdf, lat: asdf, lon: asdf, confidence: asdf } ) ); ... allDetections.addFeatures(featuresAll); Is it normal that the web browser does not let me load the layer? it says that a javascript script is taking a lot of time, and I need to stop it, but after 5 minutes the layers is loaded. Features layers are usually used for a lower number of features?? Thanks Joaquín Rodríguez-Guerra Urcelay Unidad de Sistemas de Procesamiento de Ciencia y de Observación de la Tierra / Science and Earth Observing Processing Systems Unit GMV AEROSPACE AND DEFENCE, S.A. Isaac Newton, 11 P.T.M. Tres Cantos E-28760 Madrid Tel. +34 91 807 21 00 / 7694 Fax +34 91 807 21 99 www.gmv.com ________________________________________ De: Joaquín Rodriguez-Guerra Urcelay Enviado el: martes, 28 de septiembre de 2010 19:26 Para: Joaquín Rodriguez-Guerra Urcelay Asunto: RV: [OpenLayers-Users] Question about Filtering Features in a Vector Layer -----Mensaje original----- De: [email protected] [mailto:[email protected]] En nombre de Andreas Hocevar Enviado el: martes, 28 de septiembre de 2010 11:11 Para: Joaquín Rodríguez-Guerra Urcelay CC: [email protected] Asunto: Re: [OpenLayers-Users] Question about Filtering Features in a Vector Layer Hi, you may want to have a look at the new Filter strategy: http://dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/OpenLayers/Strategy/Filter-js.html This requires OpenLayers >= 2.10. Regards, Andreas. On Sep 28, 2010, at 10:58 , Joaquín Rodríguez-Guerra Urcelay wrote: > Hello list! > > I am trying to filter the features in a vector layer so I can decide which of >them are displayed on the map and which are not. I have succesfully created >the >vector layer allDetections with the code below, and I can see all the >detections >in openlayers. But I cant fiter by a certain field. I used this code: > > allDetections.filter =new >OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property: > 'confidencei',value: 1200}); > allDetections.refresh({force: true}); > > Executing these two lines when clicking on a button does nothing in the > map,no >filtering. Is this filtering possible? after googling for a while I cant find >anything about filtering vector layers filled manually. > > I really appreciate your help! thanks!! > > Regards. > > > // CREATE DETECTIONS LAYER > > var styleAllDetections = { styleMap: new OpenLayers.StyleMap( {"default": { > > >graphicName: "ship", > > >rotation: "${heading}" > } , > } > ) >}; > allDetections = new OpenLayers.Layer.Vector("Detections", >styleAllDetections); > var featuresAll = []; > > <!-- FILL VECTOR LAYER WITH THE ITEMS OF THE DETECCTIONS LIST --> > <logic:iterate name="product" property="detections" id="item"> > featuresAll.push(new OpenLayers.Feature.Vector(new >OpenLayers.Geometry.Point(<bean:write name="item" property="lon"/>, ><bean:write >name="item" property="lat"/>), > { id: <bean:write >name="item" property="id"/>, > lat: <bean:write >name="item" property="lat"/>, > lon: <bean:write >name="item" property="lon"/>, > confidence: <bean:write >name="item" property="confidence"/ > } ) ); > </logic:iterate> > > allDetections.addFeatures(featuresAll); > map.addLayer(allDetections); > > Best regards. > _______________________________________________ > Users mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/openlayers-users _______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users ______________________ This message including any attachments may contain confidential information, according to our Information Security Management System, and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it. ______________________ Este mensaje, y en su caso, cualquier fichero anexo al mismo, puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje erroneamente, se ruega lo notifique al remitente y proceda a su borrado. Gracias por su colaboracion. ______________________ _______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
