Wrong marker position

Dec 4, 2009 at 11:44 AM


I try to place custommarker on location where user clicks. But marker always appears at upper left corner of mapcontrol. Stepping in code shows me the right values.

What can be wrong in code?


Dim myPosition As System.Windows.Point = Mouse.GetPosition(GMapControl1)
Dim myPoint As GMap.NET.PointLatLng
myPoint = GMapControl1.FromLocalToLatLng(CInt(myPosition.X), CInt(myPosition.Y))
Dim myMarker As GMapMarker = New GMap.NET.WindowsPresentation.GMapMarker(myPoint)
myMarker.Position = myPoint

Dim myCircle As New Ellipse
myCircle.Height = 5
myCircle.Width = 5
myCircle.Fill = Windows.Media.Brushes.Black
myMarker.Shape = myCircle

I use same principal for using a polygon as marker and that works

<font size="2">







Dec 4, 2009 at 12:09 PM

because your marker doesn't have offset, call myMarker.ForceUpdateLocalPosition(GMapControl);

Dec 4, 2009 at 12:22 PM


Again: THANX.