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
245
How to Hie tooltip ?
posted

Hi , i just want to hide the tooltip of a symbole element , how to make this ? Thanks 

Parents
No Data
Reply
  • 2505
    Offline posted

    Hi bouhmid86,

    To achieve this, you could try to implement an approach similar to the following:

    XAML:
        <Grid x:Name="LayoutRoot" Background="White">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="auto"/>
            </Grid.RowDefinitions>
           
            <igMap:XamMap x:Name="map1" Grid.Row="0">
                <igMap:XamMap.Layers>
                    <igMap:MapLayer x:Name="statesLayer" 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>
           
            <Button x:Name="btnRemoveTexasToolTip" Content="Remove TX Tooltip" Click="btnRemoveTexasToolTip_Click" Width="300" Height="100" Grid.Row="1"/>
        </Grid>

    CB:
            private void statesLayer_Imported(object sender, Infragistics.Controls.Maps.MapLayerImportEventArgs e)
            {
                if (e.Action == Infragistics.Controls.Maps.MapLayerImportAction.End)
                {
                    Point originNebraska = map1.MapProjection.ProjectToMap(new Point(-101.60, 42.90));
                    Point originTexas = map1.MapProjection.ProjectToMap(new Point(-96.3, 29.9));

                    SymbolElement elementNebraska = new SymbolElement() { SymbolOrigin = originNebraska, Caption = "Nebraska", SymbolType = MapSymbolType.Diamond, SymbolSize = 20, ToolTip = "NebraskaSymbolTooltip" };
                    SymbolElement elementTexas = new SymbolElement() { SymbolOrigin = originTexas, Caption = "Texas", SymbolType = MapSymbolType.Hourglass, SymbolSize = 20, ToolTip = "TexasSymbolTooltip" };

                    map1.Layers[0].Elements.Add(elementNebraska);
                    map1.Layers[0].Elements.Add(elementTexas);
                }
            }

            private void btnRemoveTexasToolTip_Click(object sender, RoutedEventArgs e)
            {
                foreach (MapElement el in map1.Layers[0].Elements)
                {
                    if (el.Caption == "Texas")
                    {
                        el.ToolTip = null;
                    }
                }
            }

    Best Regards,
    Milana Zhileva

Children
No Data