How can I draw a line or move an image on the Sharpmap?

Topics: General Topics
Sep 27, 2006 at 6:21 AM

How can I draw a line or move an image on the Sharpmap based on latitude and longitude of a Sharpmap?

Sep 27, 2006 at 6:56 AM

You can use the Geometry provider for both cases.
Just add a line to it and add the layer to your map.
The moving image you can achieve by using a single point
and then put your image into the symbol.

Sep 28, 2006 at 7:43 AM
Hello Volleyknaller,

Thanks for the reply,
How can I display an image on the SharpMap where ever I click on the SharpMap dynamically?

I am able to change the lat and long of SharpMap into X,Y coordinates, but I am unable to display an image based on it dynamically.

myMap.Center = SharpMap.Utilities.Transform.MapToWorld(new System.Drawing.Point(e.X, e.Y), myMap);
double a, b;
SharpMap.Geometries.Point p = myMap.ImageToWorld(new System.Drawing.PointF(e.X, e.Y));

a = p.X;
b = p.Y;

txtLatitude.Text = a.ToString();
txtLongitude.Text = b.ToString();

System.Drawing.PointF p1 = myMap.WorldToImage(new SharpMap.Geometries.Point(a, b));

double i, j;
i = p1.X;
j = p1.Y;

txtXcd.Text = i.ToString();
txtYcd.Text = j.ToString();

can u plz help me in getting the next step to follow, for displaying an image based on these i,j coordiantes dynamically.