This is a migrated thread and some comments may be shown as answers.

Not able to clear tooltips when hovering over icons on telerik map

1 Answer 76 Views
Map
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
sri
Top achievements
Rank 1
sri asked on 02 Feb 2012, 09:40 AM
I have icons displayed on the telerik map. These icons are added to an information layer at run-time and the colour of the icon is decided by choosing a datatemplate at runtime.
The code for the datatemplate and information layer are given below.

The issue that I am facing is when i hover on the icons, the tooltip of the previous icon is displayed along with the tooltip of the current icon. The result is that tooltips appear to overlap when the user hovers from one icon to another very fast. Tooltip has a display time of 20 secs which seems to be causing this. But, this functionality of displaying the tooltip for a specified duration cannot be removed.
Is there any way to clear the previous tooltip in code-behind?

 

 

 

 

<telerik:InformationLayer x:Name="informationLayerGPSEastSelected" ItemTemplate="{StaticResource GPSEastSelected}" MouseLeftButtonDown="informationLayer_MouseLeftButtonDown"/>

<

 

 

DataTemplate x:Key="GPSEastSelected">

 

 

 

 

<Border Background="Transparent" telerik:MapLayer.Location="{Binding Location}">

 

 

 

 

<Controls:ToolTipService.ToolTip>

 

 

 

 

<Controls:ToolTip DisplayTime="00:00:20" InitialDelay="00:00:00" IsEnabled="True" Style="{StaticResource ToolTipStyle2}" >

 

 

 

 

<ToolTip x:Name="telerikTooltip3" Loaded="telerikTooltip_Loaded" Style="{StaticResource ToolTipStyle1}" Opacity="0.8" BorderBrush="Transparent" BorderThickness="0" >

 

 

 

 

<ToolTip.Template>

 

 

 

 

<ControlTemplate>

 

 

 

 

<Border CornerRadius="15">

 

 

 

 

<Border.Background>

 

 

 

 

<SolidColorBrush Color="White"/>

 

 

 

 

</Border.Background>

 

 

 

 

<ContentPresenter Margin="5">

 

 

 

 

<ContentPresenter.Content>

 

 

 

 

<Grid x:Name="LayoutRoot">

 

 

 

 

<Grid.ColumnDefinitions>

 

 

 

 

<ColumnDefinition Width="180" />

 

 

 

 

<ColumnDefinition Width="Auto" />

 

 

 

 

</Grid.ColumnDefinitions>

 

 

 

 

<Grid.RowDefinitions>

 

 

 

 

<RowDefinition Height="Auto"/>

 

 

 

 

<RowDefinition Height="Auto" />

 

 

 

 

<RowDefinition Height="Auto" />

 

 

 

 

<RowDefinition Height="Auto" />

 

 

 

 

<RowDefinition Height="Auto" />

 

 

 

 

<RowDefinition Height="Auto" />

 

 

 

 

<RowDefinition Height="Auto" />

 

 

 

 

<RowDefinition Height="Auto" />

 

 

 

 

<RowDefinition Height="Auto" />

 

 

 

 

<RowDefinition Height="Auto" />

 

 

 

 

<RowDefinition Height="Auto" />

 

 

 

 

</Grid.RowDefinitions>

 

 

 

 

<StackPanel Grid.ColumnSpan="2" Orientation="Horizontal" Grid.Column="0" Grid.Row="0">

 

 

 

 

<Image Height="40" Width="45" Source="{Binding BLOB_ICON, Converter={StaticResource ImageConverter}}" Stretch="Fill" Cursor="Hand" x:Name="toolImage"/>

 

 

 

 

<TextBlock>

 

 

 

 

<Run Text=" "/>

 

 

 

 

<Run FontSize="24" FontWeight="Bold" Text="{Binding Path=C_TRACER_NAME}"/>

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Grid.Row="1" Grid.Column="0" >

 

 

 

 

<TextBlock FontWeight="Bold" Text="{Binding Path=TTTracerId, Source={StaticResource Strings}}" />

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1">

 

 

 

 

<TextBlock FontWeight="Bold" HorizontalAlignment="Right" Text=":" Padding="0,0,5,0" />

 

 

 

 

<TextBlock HorizontalAlignment="Left">

 

 

 

 

<Run Text="{Binding Path=TracerId}"/>

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="2">

 

 

 

 

<TextBlock>

 

 

 

 

<Run FontWeight="Bold" Text="{Binding Path=TTTracerName, Source={StaticResource Strings}}"/>

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="2">

 

 

 

 

<TextBlock FontWeight="Bold" HorizontalAlignment="Right" Text=":" Padding="0,0,5,0" />

 

 

 

 

<TextBlock >

 

 

 

 

<Run Text="{Binding Path=C_TRACER_NAME}"/>

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="3">

 

 

 

 

<TextBlock>

 

 

 

 

<Run FontWeight="Bold" Text="{Binding Path=TTTracerCode, Source={StaticResource Strings}}"/>

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="3">

 

 

 

 

<TextBlock FontWeight="Bold" HorizontalAlignment="Right" Text=":" Padding="0,0,5,0" />

 

 

 

 

<TextBlock >

 

 

 

 

<Run Text="{Binding Path=C_TRACER_CODE}"/>

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="4">

 

 

 

 

<TextBlock>

 

 

 

 

<Run FontWeight="Bold" Text="{Binding Path=TTTracerTime, Source={StaticResource Strings}}"/>

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="4">

 

 

 

 

<TextBlock FontWeight="Bold" HorizontalAlignment="Right" Text=":" Padding="0,0,5,0" />

 

 

 

 

<TextBlock >

 

 

 

 

<Run Text="{Binding Path=str_DT_TRACER_TIME}"/>

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="5">

 

 

 

 

<TextBlock>

 

 

 

 

<Run FontWeight="Bold" Text="{Binding Path=TTLastMovement, Source={StaticResource Strings}}" />

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="5">

 

 

 

 

<TextBlock FontWeight="Bold" HorizontalAlignment="Right" Text=":" Padding="0,0,5,0" />

 

 

 

 

<TextBlock >

 

 

 

 

<Run Text="{Binding Path=str_DT_LAST_MOVEMENT}" />

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="6">

 

 

 

 

<TextBlock>

 

 

 

 

<Run FontWeight="Bold" Text="{Binding Path=TTPosition, Source={StaticResource Strings}}" />

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="6">

 

 

 

 

<TextBlock FontWeight="Bold" HorizontalAlignment="Right" Text=":" Padding="0,0,5,0" />

 

 

 

 

<TextBlock TextWrapping="Wrap" >

 

 

 

 

<Run Text="{Binding Path=city}" />

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="7">

 

 

 

 

<TextBlock>

 

 

 

 

<Run FontWeight="Bold" Text="{Binding Path=TTDirection, Source={StaticResource Strings}}" />

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="7">

 

 

 

 

<TextBlock FontWeight="Bold" HorizontalAlignment="Right" Text=":" Padding="0,0,5,0" />

 

 

 

 

<TextBlock >

 

 

 

 

<Run Text="{Binding Path=Direction,Converter={StaticResource LocaleConverter }}" />

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="8">

 

 

 

 

<TextBlock>

 

 

 

 

<Run FontWeight="Bold" Text="{Binding Path=TTTracerStatus, Source={StaticResource Strings}}" />

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="8">

 

 

 

 

<TextBlock FontWeight="Bold" HorizontalAlignment="Right" Text=":" Padding="0,0,5,0" />

 

 

 

 

<TextBlock >

 

 

 

 

<Run Text="{Binding Path=str_ShutDownStatus}" />

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="9">

 

 

 

 

<TextBlock>

 

 

 

 

<Run FontWeight="Bold" Text="{Binding Path=Accuracy, Source={StaticResource Strings}}" />

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="9">

 

 

 

 

<TextBlock FontWeight="Bold" HorizontalAlignment="Right" Text=":" Padding="0,0,5,0" />

 

 

 

 

<TextBlock >

 

 

 

 

<Run Text="{Binding Path=Accuracy}" />

 

 

 

 

<Run Text="m" />

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="10">

 

 

 

 

<TextBlock>

 

 

 

 

<Run FontWeight="Bold" Text="{Binding Path=str_Total_Mileage, Source={StaticResource Strings}}" />

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

<StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="10">

 

 

 

 

<TextBlock FontWeight="Bold" HorizontalAlignment="Right" Text=":" Padding="0,0,5,0" />

 

 

 

 

<TextBlock >

 

 

 

 

<Run Text="{Binding Path=TotalMileage_Tooltip}" />

 

 

 

 

<Run Text="{Binding Path=MileageKM, Source={StaticResource Strings}}" />

 

 

 

 

</TextBlock>

 

 

 

 

</StackPanel>

 

 

 

 

</Grid>

 

 

 

 

</ContentPresenter.Content>

 

 

 

 

</ContentPresenter>

 

 

 

 

</Border>

 

 

 

 

</ControlTemplate>

 

 

 

 

</ToolTip.Template>

 

 

 

 

</ToolTip>

 

 

 

 

</Controls:ToolTip>

 

 

 

 

</Controls:ToolTipService.ToolTip>

 

 

 

 

<telerik:MapLayer.HotSpot>

 

 

 

 

<telerik:HotSpot X="0.5" Y="0.5" ElementName="Pin" />

 

 

 

 

</telerik:MapLayer.HotSpot>

 

 

 

 

<Canvas x:Name="Pin" Width="30" Height="30">

 

 

 

 

<Ellipse Canvas.Top="2" Canvas.Left="2" Height="26" Width="26" StrokeThickness="4" Stroke="Red" Canvas.ZIndex="1" >

 

 

 

 

<Ellipse.Fill>

 

 

 

 

<RadialGradientBrush>

 

 

 

 

<GradientStop Color="#08acf4" Offset="0.0" />

 

 

 

 

<GradientStop Color="#008fc7" Offset="1.0" />

 

 

 

 

</RadialGradientBrush>

 

 

 

 

</Ellipse.Fill>

 

 

 

 

</Ellipse>

 

 

 

 

<ed:BlockArrow Fill="#FFFFFF" Margin="9,9,7,9" Orientation="Right" Stroke="Black" StrokeThickness="0" UseLayoutRounding="False" HorizontalAlignment="Right" Width="15" Height="12" Canvas.ZIndex="2" />

 

 

 

 

</Canvas>

 

 

 

 

</Border>

 

 

 

 

</DataTemplate>

 

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 07 Feb 2012, 11:21 AM
Hello,

It is very complicated and it is hard to reproduce the problem without your solution, but using just the code snippet you sent. Could you, please, provide us with a small sample runnable solution which reproduces it?

Regards,
Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Map
Asked by
sri
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or