I looked "Buffer a Feature" sample on map suite web samples and tryed to do it but it does not draw any polygon on map.
private void BufferAFeature(string wellKnowntext)
{
InMemoryFeatureLayer mshapeLayer = (InMemoryFeatureLayer)((LayerOverlay)Map1.CustomOverlays["ShapeOverlay"]).Layers["ShapeLayer"];
Feature feature = new Feature(wellKnowntext);
mshapeLayer.InternalFeatures.Add(feature.Id,feature);
Map1.EditOverlay.Features.Add(feature.Id, feature); // if I remove this line it does not draw the first polygon
((LayerOverlay)Map1.CustomOverlays["ShapeOverlay"]).Redraw();
InMemoryFeatureLayer bufferLayer = (InMemoryFeatureLayer)((LayerOverlay)Map1.CustomOverlays["BufferOverlay"]).Layers["bufferLayer"];
AreaBaseShape baseShape = (AreaBaseShape)mshapeLayer.InternalFeatures[feature.Id].GetShape();
MultipolygonShape bufferedShape = baseShape.Buffer(10, 8, BufferCapType.Round, GeographyUnit.Meter, DistanceUnit.Meter);
Feature bufferFeature = new Feature(bufferedShape);
bufferLayer.InternalFeatures.Clear();
bufferLayer.InternalFeatures.Add("BufferFeature", bufferFeature);
((LayerOverlay)Map1.CustomOverlays["BufferOverlay"]).Redraw();
txtFeature.Text = String.Empty;
txtFeature.Text = txtFeature.Text + bufferLayer.InternalFeatures["BufferFeature"].GetWellKnownText();
}
I send "POLYGON((3869260.00994757 4910833.45833652,3866818.43713419 4815612.11861444,4018195.95156416 4803404.25454751,4008429.66031061 4905950.31270975,3869260.00994757 4910833.45833652))" as parameter
and I get this MULTIPOLYGON(((3869260.36060897 4910843.45218646,4008430.01097201 4905960.30655969,4008432.04605659 4905960.02395149,4008433.98042842 4905959.33138937,4008435.73242921 4905958.25810941,4008437.22809936 4905956.84941943,4008438.4043001 4905955.1647864,4008439.21137887 4905953.27532602,4008439.61526534 4905951.26080068,4008439.61526534 4905951.26080068,4018205.90651889 4803405.20263844,4018205.90252736 4803403.26544112,4018205.52510112 4803401.36536249,4018204.78840404 4803399.57370774,4018203.7200825 4803397.95771316,4018202.36022794 4803396.578023,4018200.75987229 4803395.48641356,4018198.97907289 4803394.72385022,4018197.08465867 4803394.31895005,4018195.14772226 4803394.28690796,3866817.63329229 4815602.15097489,3866815.77014653 4815602.48081506,3866814.00248176 4815603.15569874,3866812.39358229 4815604.15146436,3866811.00104842 4815605.43246245,3866809.87473436 4815606.95283191,3866809.05496334 4815608.6581419,3866808.57108405 4815610.4873405,3866808.44041988 4815612.37494045,3869250.01323326 4910833.71466253,3869250.25792822 4910835.6715059,3869250.8818901 4910837.54227664,3869251.86085232 4910839.25421839,3869253.15674195 4910840.74075183,3869254.71916039 4910841.94406401,3869256.48734345 4910842.81735678,3869258.39252452 4910843.32666681,3869260.36060897 4910843.45218646)))
but it does not draw anything.
1. What I missing ?
2. I want to make it with LINE not POLYGON so the user will draw the line and I will find the MULTIPOLYGON of the line