Register  |  Login   Search
ThinkGeo - GPS Tracking and Mapping Solutions  |  Home  |  Cygnus Track  |  Developer Community
 
LivePerson Chat

Discussion Forums

The online community for users of Map Suite GIS components

Showing ToolTip when plotting points
Last Post 12-01-2008 03:56 AM by Scott. 4 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
MahenderUser is Offline
Level 1
Level 1
Posts:24

--
11-18-2008 06:03 AM

Hi all,

iam geeting points from the database and plotting those points

one by one with 1 second gap using timer Control.

My Sample Code is:

if (mapcount < mapDs.Tables[0].Rows.Count)
            {
                double longitude = Convert.ToDouble(mapDs.Tables[0].Rows[mapcount]["longitude"].ToString());
                double latitude = Convert.ToDouble(mapDs.Tables[0].Rows[mapcount]["latitude"].ToString());
                //
                MapSuite.Geometry.PointShape ps = new MapSuite.Geometry.PointShape(longitude, latitude);
                Ellipse es = new Ellipse(ps, 0.79, MapLengthUnits.DecimalDegrees, MapLengthUnits.kilometres);
                BaseAreaShape bas = es;
                AreaMapShape areaMapShp = new AreaMapShape(bas);
                if (mapDs.Tables[0].Rows[mapcount]["CalendarYear"].ToString() == System.DateTime.Today.Year.ToString())
                    areaMapShp.ZoomLevel01.GeoStyle = GeoAreaStyles.GetSimpleAreaStyle(GeoColor.SimpleColors.DarkBlue, GeoColor.KnownColors.DarkBlue, 2);
                else
                    if (mapDs.Tables[0].Rows[mapcount]["CalendarYear"].ToString() == Convert.ToString(System.DateTime.Today.Year - 1))
                        areaMapShp.ZoomLevel01.GeoStyle = GeoAreaStyles.GetSimpleAreaStyle(GeoColor.SimpleColors.DarkGreen, GeoColor.KnownColors.DarkGreen, 2);
                    else
                        areaMapShp.ZoomLevel01.GeoStyle = GeoAreaStyles.GetSimpleAreaStyle(GeoColor.SimpleColors.Red, GeoColor.KnownColors.Red, 2);
                areaMapShp.ZoomLevel01.GeoTextStyle = GeoTextStyles.GetSimpleTextStyle(null, "Arial", 9, GeoFontStyle.Bold, GeoColor.KnownColors.Black);
                areaMapShp.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.ZoomLevel18;
                map1.MapShapes.Add(areaMapShp);               
                mapcount = mapcount + 1;           
                map1.RefreshDynamic();
            }

Now I want to display tooltip (information about the point)whenever point is plotted on the map.

for each point i need to display the tooltip .the time span between the plotting points is 1 sec.

Hiw can i achieve this.

This is Urgent.

Thanking you.

 

RyanUser is Offline
ThinkGeo Support
MVP
MVP
Posts:176
Avatar

--
11-18-2008 12:21 PM

Mahender,

For an excellent example of how to implement tooltips please see our ToolTipApp sample application included in the sample applications.
 

MahenderUser is Offline
Level 1
Level 1
Posts:24

--
11-19-2008 01:09 AM

Hi, In ToolTipApp Sample tooltips are displaying whenever Mouse over the shape and you wrote Code in DisplayToolTip event.

But my requirement os i have to display tooltip whenever point is plotted on the map.

 

 

BrendanUser is Offline
Level 3
Level 3
Posts:76
Avatar

--
11-19-2008 12:25 PM
Mahender

Taking a quick look at the ToolTip code now, I don't know that you can do that with it.

When we were evaluating whether or not to use ToolTips, we decided against them as we couldn't do everything we wanted to do with the ToolTip functionality.

If you are dead set on using a ToolTip, then I can't offer you much advice. But i'll tell you what we did anyhow. We ended up displaying the information that we would have displayed in a ToolTip in a control above the map. This gave us a bit more flexibility in showing it when we wanted.. and it listened to events to populate its information, so it really wasn't difficult to code.

The only other alternative I can think of off the top of my head is to build up a ToolTip with the information you need in it using MapShapes (using an AreaShape with a TextSymbol for example). With these shapes, you can very easily remove them (or edit them etc) with minimal impact on performance using RefreshDynamic().

I haven't done it this way yet, but it is a possibility. With the right FillColor and Outline Colour, you could get it to look alright. The only tricky bit would be deciding on the size of the AreaShape.

Hope this helps.
If the facts don't fit the theory... change the facts
ScottUser is Online
MVP
MVP
Posts:54
Avatar

--
12-01-2008 03:56 AM
The Tooltip will be displaying text whenever Mouse over the shape, not for click or finish track shape event. If you want to do this, I suggest you that you can use textsymbol to display the text on the point map shape.

You can use the following code to add the text symbol to the point map shape:

GeoFont font = new GeoFont("Arial", 8, GeoFontStyle.Bold);
GeoSolidBrush txtBrush = new GeoSolidBrush(GeoColor.KnowColors.DarkOliveGreen);
TextSymbol txtSymbol = new TextSymbol(font, txtBrush);
PointMapShape.TextSymbols.Add(txtSymbol);

Thanks,
You are not authorized to post a reply.

Active Forums 4.1