Akku,
Hope my understanding is not too far from you. See following code using the edit logic used in the HowDoI sample, the code will update the location of the point in the MapClick event.
private void Form1_Load(object sender, EventArgs e)
{
//Set the full extent and the background color
winformsMap1.MapUnit = GeographyUnit.Meter;
winformsMap1.CurrentExtent = new RectangleShape(-10000000, 10000000, 10000000, -10000000);
GoogleMapsLayer googleMapLayer = new GoogleMapsLayer();
googleMapLayer.CacheDirectory = @"..\..\GoogleMapImageCache";
InMemoryFeatureLayer pointLayer = new InMemoryFeatureLayer();
pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.City1;
pointLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
double longtitude = 77.217;
double lattidue = 28.667;
Proj4Projection proj4 = new Proj4Projection();
proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326);
proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();
proj4.Open();
Vertex vertex = proj4.ConvertToExternalProjection(longtitude, lattidue);
proj4.Close();
pointLayer.InternalFeatures.Add("Point",new Feature(vertex,"Point"));
LayerOverlay layeroverlay = new LayerOverlay();
layeroverlay.Layers.Add(googleMapLayer);
layeroverlay.Layers.Add("PointLayer",pointLayer);
winformsMap1.Overlays.Add("LayerOverlay", layeroverlay);
winformsMap1.MapClick += new EventHandler<MapClickWinformsMapEventArgs>(winformsMap1_MapClick);
winformsMap1.Refresh();
}
void winformsMap1_MapClick(object sender, MapClickWinformsMapEventArgs e)
{
double x= e.WorldX;
double y = e.WorldY;
InMemoryFeatureLayer pointLayer = (InMemoryFeatureLayer)winformsMap1.FindFeatureLayer("PointLayer");
pointLayer.Open();
pointLayer.EditTools.BeginTransaction();
Feature newFeature = new Feature(e.WorldX,e.WorldY,"Point");
pointLayer.EditTools.Update(newFeature);
TransactionResult result = pointLayer.EditTools.CommitTransaction();
pointLayer.Close();
Overlay overlay = winformsMap1.Overlays["LayerOverlay"];
winformsMap1.Refresh(overlay);
}
Any more questions just feel free to let me know.
Thanks.
Yale