how to add a tooltip to an multipoint in a SharpMap

Topics: General Topics
Oct 18, 2006 at 10:42 AM
Hello,

I am able to place a multipoint on the SharpMap dynamically. But I am unable to add tooltip for it.

Plz help me in getting the tooltip for it.

Thanks in advance





Coordinator
Oct 18, 2006 at 11:29 PM
Which version of SharpMap?
Oct 25, 2006 at 7:03 AM
Hello,


Thanks for the reply,
I am using SharpMap file version 0.9.0.0
Here, my problem is:

I am able to place an image on the map by converting it into Bitmap image dynamically but I am unable to add the tooltip for it.

here is the code how I have added the dynamic image on the SharpMap.

MultiPoint multiPoint = new MultiPoint();
multiPoint.Points.Add(pointClicked);

SharpMap.Data.Providers.GeometryProvider geometryProvider = new SharpMap.Data.Providers.GeometryProvider(multiPoint);

SharpMap.Layers.VectorLayer laySelected = new SharpMap.Layers.VectorLayer("street_polyline");

laySelected.Style.Line = new Pen(Color.Black, 3);
laySelected.DataSource = geometryProvider;
laySelected.Style.Fill = new SolidBrush(Color.Blue);
laySelected.MaxVisible = 10000;
laySelected.SRID = 4326;
laySelected.Enabled = true;
laySelected.Style.Symbol = new Bitmap(HttpContext.Current.Server.MapPath(@"CAB2.JPG"));
laySelected.Style.SymbolScale = 0.8f;
myMap.Layers.Add(laySelected);

ViewState.Add("mapCenter", myMap.Center);
CreateMap();

plz send some sample code for displaying text on the Bitmap Image/multipoint using tooltip



Oct 27, 2006 at 6:05 AM

Hello,


Thanks for the reply,
I am using SharpMap file version 0.9.0.0
Here, my problem is:

I am able to place an image on the map by converting it into Bitmap image dynamically but I am unable to add the tooltip for it.

here is the code how I have added the dynamic image on the SharpMap.

MultiPoint multiPoint = new MultiPoint();
multiPoint.Points.Add(pointClicked);

SharpMap.Data.Providers.GeometryProvider geometryProvider = new SharpMap.Data.Providers.GeometryProvider(multiPoint);

SharpMap.Layers.VectorLayer laySelected = new SharpMap.Layers.VectorLayer("street_polyline");

laySelected.Style.Line = new Pen(Color.Black, 3);
laySelected.DataSource = geometryProvider;
laySelected.Style.Fill = new SolidBrush(Color.Blue);
laySelected.MaxVisible = 10000;
laySelected.SRID = 4326;
laySelected.Enabled = true;
laySelected.Style.Symbol = new Bitmap(HttpContext.Current.Server.MapPath(@"CAB2.JPG"));
laySelected.Style.SymbolScale = 0.8f;
myMap.Layers.Add(laySelected);

ViewState.Add("mapCenter", myMap.Center);
CreateMap();

I want to display the vehicle Id which is stored in the database as a tooltip to the dynamic image(multipoint) /bitmap image.

Thanks in advance

Sep 25, 2007 at 5:19 AM
Hi Anveshini,
I am also having the same problem. If you got the code can you please post the sample code.

Thanks.
Coordinator
Sep 25, 2007 at 5:27 AM
Are you looking for a tooltip (the little popup windows) or a label (text drawn near or on the feature)? A tooltip you'd have to implement yourself, but label functionality comes with SharpMap via adding a LabelLayer to your map.
Sep 25, 2007 at 5:45 AM
Thanks for the fast reply.
I need the popup windows which gives the information about the point clicked.
The latitude and longitude are taken from the database with the details dynamically. The icons should be placed according to the lat long position. I want to display the details when the image icon is clicked.
Want to know which property in sharpmap I can use for this.
Sep 27, 2007 at 7:40 AM
Help Please !!!!!!
How to add icons. On click of icon i want to show the details of that particular point.
Like Adding pushpin to the VE.

Urgent !
Coordinator
Sep 28, 2007 at 8:44 AM
You'll have to code this yourself by getting the image coordinates of the mouse click, translating them to world coordinates, and drawing an image at that point or putting some windowed control there (like a System.Windows.Forms.Label). The nice thing about the latter is that you get some help from Win32 for doing things like pop-ups very easily.
Oct 4, 2007 at 8:16 AM
Thanks codekaizen,
I got the latlong points where the mouse is clicked. But I need to place an image control over the points instead of symbol. So that I can add attibutes to the image and I can utilize this in my AJAX project.
Any help with examples would be great.
Thanks
Oct 11, 2007 at 5:46 AM
Hello Friends,

Still searching to add tooltip over map. I could not draw any image over image.
Please help me. with some example code.

Coordinator
Oct 14, 2007 at 8:13 AM
You can use Graphics.DrawImage() to draw an image on an image.
Oct 17, 2008 at 5:35 AM
Hello, Umasam

Have you got any solution for that problem ?