Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
715
problem with tooltips
posted

Hi, 

I have a problem when I put tooltips on my SymbolLayer.

I've seen this thread with similar issues:

http://community.infragistics.com/forums/p/48443/257341.aspx

I've tried putting ToolTip on the SymbolElement in different ways:

element.ToolTip = string.Format("Value: {0} ", value);

also with the suggested approach in the other thread

 UCToolTip toolTip = new UCToolTip(name); //, bank, metricName, metricValue);

 System.Windows.Controls.ToolTip myMapTip = new System.Windows.Controls.ToolTip();

element.ToolTip = myMapTip;

and also with my Own control MapTooltip.

When I zoom in and out on the map, using the mouse scroller, I get regulary a popup stating 'Object reference not set to instance of an object'. 

If I comment out the assignment of the ToolTip on the element. I no longer get the popup stating this problem.

Any ideas how to fix these?

 

 

 

 

 

 

Parents
  • 2505
    Offline posted

    Hi Roel,

    Here is a sample demo on how can SymbolElement's tooltip be set.
    XAML:
            <igMap:XamMap x:Name="map1">
                <igMap:XamMap.Layers>
                    <igMap:MapLayer x:Name="statesLayer" DataMapping="Name=CNTRY_NAME; ToolTip=PENETRATIONPERCENT" Imported="statesLayer_Imported">
                        <igMap:MapLayer.Reader>
                            <igMap:ShapeFileReader Uri="Shapefiles/usa/usa_st" DataMapping="Name=STATE_NAME; Value=POP1997; Caption=STATE_ABBR"/>
                        </igMap:MapLayer.Reader>
                    </igMap:MapLayer>
                </igMap:XamMap.Layers>
            </igMap:XamMap>
    CB:
    private void statesLayer_Imported(object sender, Infragistics.Controls.Maps.MapLayerImportEventArgs e)
            {
                if (e.Action == Infragistics.Controls.Maps.MapLayerImportAction.End)
                {
                    Point origin = map1.MapProjection.ProjectToMap(new Point(-101.6015625, 42.032974332441405));
                    SymbolElement element = new SymbolElement() { SymbolOrigin = origin, Caption = "Marker", SymbolType = MapSymbolType.Diamond, SymbolSize = 20 };

                    string value = "NE";
                    element.ToolTip = string.Format("Value: {0} ", value);

                    map1.Layers[0].Elements.Add(element);
                }
            }
    Is this the same approach you are using?

    Best regards,
    Milana Zhileva

Reply Children