I don't know the reason.
This is my custom marker code,
public class GMapImage : GMapMarker
GMapImage gmimage;
gmimage = new GMapImage(new PointLatLng(latitude, longitude));
gmimage.Size = gMapControl1.Size;
var TL= gMapControl1.FromLocalToLatLng(gMapControl1.Location.X,gMapControl1.Location.Y);
gmimage.Position = TL;
gmimage.Image = bMap; // bmap is my image
transmarkers.Markers.Add(gmimage);
gMapControl1.Overlays.Add(transmarkers);
Please let me know if i am doing something wrong over here
This is my custom marker code,
public class GMapImage : GMapMarker
{
private Image image;
public Image Image
{
get
{
return image;
}
set
{
image = value;
if (image != null)
{
this.Size = new Size(image.Width, image.Height);
}
}
}
public GMapImage(GMap.NET.PointLatLng p) : base(p)
{
DisableRegionCheck = true;
IsHitTestVisible = false;
}
public override void OnRender(Graphics g)
{
if (image == null)
return;
g.DrawImage(image, LocalPosition.X, LocalPosition.Y, Size.Width, Size.Height);
}
}
and this is how i place an image over map,GMapImage gmimage;
gmimage = new GMapImage(new PointLatLng(latitude, longitude));
gmimage.Size = gMapControl1.Size;
var TL= gMapControl1.FromLocalToLatLng(gMapControl1.Location.X,gMapControl1.Location.Y);
gmimage.Position = TL;
gmimage.Image = bMap; // bmap is my image
transmarkers.Markers.Add(gmimage);
gMapControl1.Overlays.Add(transmarkers);
Please let me know if i am doing something wrong over here