Hi List,

I have played a little bit with GeoExt and figured out that you can remove
Records from the Store to remove the Features from the map.

 

store = new GeoExt.data.FeatureStore({

        layer: vecLayer,

        fields: [

            {name: 'name', type: 'string'},

            {name: 'id', type: 'string'}

        ],

        proxy: new GeoExt.data.ProtocolProxy({

            protocol: new OpenLayers.Protocol.HTTP({

                url: "point.asp",  // this is due to IIS

                format: new OpenLayers.Format.GML()

            })

        }),

                autoLoad: true

    });

 

 

Now I'm creating a new Layer, applying a filter to the old Store and
creating a new Store

tmpLayer = new OpenLayers.Layer.Vector("Vector 2");

 

store.filter('id', 'value', true, true);

tmpStore = new GeoExt.data.FeatureStore({

       layer: tmpLayer


});

 

 

To remove some Records from the Store

 

for (i = 0; i < store.getCount(); i++) {

      var record = store.getAt(i);

      tmpStore.add(record);

}

 

Does anybody has a better solution. It's working but I have some trouble
with the eventListeners when selecting Features.

 

Best regards,

Mario

_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users

Reply via email to