ShapeFeature f = createFeature(g);
layer.getFeatures().insert(f);
f.setFeatureClass(layer.getFeatures());
EnvelopeBuf eb = new EnvelopeBuf(layer.getEnvelop());
eb.mergeEnvelop(g.getEnvelop());
((FeatureSet)layer.getFeatures()).setEnvelope(eb.toEnvelop());
map.getLayerCollection().reComputeEnvelop();
}
}
private ShapeFeature createFeature(Geometry g)