Hi Charles,
The post code works for me. You can try to create a real simple web edition project with our map control.
Then add the server side code:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
this.Map1.MapUnit = GeographyUnit.Meter;
Map1.CurrentExtent = new RectangleShape(-131.22, 55.05, -54.03, 16.91);
Map1.EditOverlay.Features.Add(new Feature(new RectangleShape(-131.22, 55.05, -54.03, 16.91)));
}
}
}
And add client side code:
[CODE] <script type="text/javascript">
var OnMapCreated = function (map) {
Map1.SetDrawMode('Rectangle');
var vectorLayer = map.getLayersByName("EditOverlay")[0];
if (vectorLayer) {
document.getElementById(map.clientId).oncontextmenu = function () { return false; };
vectorLayer.events.register("mousedown", vectorLayer, function (evt) {
if (evt && evt.button == 2) {
var feature = this.getFeatureFromEvent(evt);
if (feature != null) {
this.removeFeatures([feature]);
}
}
});
}
}
</script>
When you see the rectangleshape, right click it will be deleted.
Regards,
Don