[OpenLayers-Users] destroyFeatures Function Question

Matt Kenny matthewkenny at gmail.com
Sun Apr 19 13:53:09 EDT 2009


Hello Everyone,

I have a question about the destroyFeatures function of the Vector Layer
class that I was hoping someone could help me answer. I'm currently working
on the following example:
http://mkgeomatics.com/apps/ajax_dev/Deliverable/checkbox_form_logged_in.htmland
am trying to selectively destroy vector features based a unique
attribute. For example, I have three types of features contained within a
single vector layer: airports, routes, and companies. Airports and routes
will be dynamically displayed based on data returned from the server, but
the user will have not have the ability to selectively turn them on or off.
Companies on the other hand, can be selected based on their unique company
type ID. I've created an array that is designed to be populated with
features that do not match a COMPANY_ID of 'airport' or 'emptyLeg' (routes),
which should hold all of the companies currently in the vector layer. These
features are destroyed and the new companies which a user has selected are
displayed on the map.

Currently however, the routes / airports / and companies are all being
destroyed, followed by the correct companies being displayed.

I'd appreciate any help regarding this. I'm wondering if I'm using this
function properly!

A live example can be viewed here:
http://mkgeomatics.com/apps/ajax_dev/Deliverable/checkbox_form_logged_in.html

The function in question can be viewed here (line 156 function
AddCompanies()):
http://mkgeomatics.com/apps/ajax_dev/Deliverable/gis/scripts/mapCode_logged_in.js

Thanks for any advice or suggestions.

Take care,
Matt

-- 
m a t t h e w k e n n y
http://www.mkgeomatics.com
Sent from Tempe, AZ, United States
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090419/c5997b26/attachment.html


More information about the Users mailing list