void CAMHiliteLayer::RemoveAll()
{
BeginAccess(miAccessReadWrite);
CMapXFeatures fs = AllFeatures();
for (long nItem=1; nItem<=fs.GetCount(); nItem++)
DeleteFeature(fs.Item(nItem).GetFeatureKey());
EndAccess();
}
如果觉得这样很慢,那么
Maybe you make an empty copy of the layer using the feature Rowset structure and than exchange the old layer by the new created one.
{
BeginAccess(miAccessReadWrite);
CMapXFeatures fs = AllFeatures();
for (long nItem=1; nItem<=fs.GetCount(); nItem++)
DeleteFeature(fs.Item(nItem).GetFeatureKey());
EndAccess();
}
如果觉得这样很慢,那么
Maybe you make an empty copy of the layer using the feature Rowset structure and than exchange the old layer by the new created one.