MapTips HideDelay multiple feature layers

2767
15
02-21-2011 10:43 AM
DaveOrlando
Occasional Contributor III
Hello,

I am experiencing some odd behavior after adding a second FeatureLayer (with MapTips) to my map.

It seems that the MapTipHideDelay is only honored by one FeatureLayer at a time?.... If both features are visible and using MapTips, (line and polygon, but not overlapping) it seems like the last loaded MapTip will honor the HideDelay but the other goes back to no hidedelay.

tough to replicate, sometomes they both seem to work, other times not. Is anyone experiencing similar results and also, has there been more work done on maptips since 2.1.0.427

Any help would be great, thanks.
0 Kudos
15 Replies
JenniferNery
Esri Regular Contributor
I think I know what you are talking about. If you use the following sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#GraphicsMapTip

Only the States layer have a MapTipHideDelay. When you mouse over Washington and then to another feature (States layer: Idaho or Cities layer: Spokane), the MapTipHideDelay is not used. This is by design, once you enter another feature, the previous map tip should close immediately to open another map tip. If however, you are moving your mouse from Washington towards Vancover where there is no other feature, you will find that the MapTipHideDelay is used.

Could you verify that this is the behavior you are seeing in your app? If not, please send share code that will help us reproduce the issue. Thanks.
0 Kudos
DaveOrlando
Occasional Contributor III
Hi Jennifer,

Unfortunately this was not the case. None of my features overlap at all, yet the MapTips do no play well together. They never all (3 feature layers) honor the HideDelay. Usually either my polygon layer works and the two line features don't or vise versa, but never all three.

It think it has something to do with how they are initialized. My poygon layer is by selection, so it is tied to an editor, the line features are on demand, with scale dependency so each of the three layers are, by design, turning on and off quite frequently and hence, the delays are maybe not getting set? does that make sense?
0 Kudos
JenniferNery
Esri Regular Contributor
Can you share some code that will help us reproduce with one of the sampleserver feature services? Thanks.
0 Kudos
DarkoRadiceski
New Contributor II
Dear all,

We seem to be seeing the same weird behaviour. We are dealing with GeoRss layers using ESRI.ArcGIS.Client.Toolkit.DataSources.

We can add MapTips and if there is only one layer on the map the HideDelay property works great. But when we add more then one Graphic Layer i.e more then one GeoRss layer then all turns to custard. The HideDelay property does not get honored.

This is the code: GraphicsLayer.SetMapTipHideDelay(maptip, new TimeSpan(0, 0, 1));

maptip is a user control. Just a stack panel. Nothing more.

Any advice on how we could fix this?

Any help would be appreciated.
0 Kudos
JenniferNery
Esri Regular Contributor
Do all FeatureLayers share the same FrameworkElement maptip?

I was not able to reproduce this if each layer had a different maptip. It might be simpler to set this in XAML:
esri:GraphicsLayer.MapTipHideDelay="00:00:01.5"
0 Kudos
DarkoRadiceski
New Contributor II
Dear Jennirer,

What do you mean by different map tip? Can you provide a code example?

I our case we have a user control for the map tip. We instantiate an object and then assign it to the map til. The HideDelay is set once when we load each layer. So if we have 3 layers this is set 3 times.

GraphicsLayer.SetMapTipHideDelay(maptip, new TimeSpan(0, 0, 1));
0 Kudos
DarkoRadiceski
New Contributor II
We also tried to set it in XAML as you suggested but it doesnt seem to help.

After i add the second layer the map tips start missbehaving.

This is the code we have for the UserControl used for the MapTip

<UserControl x:Class="GeoRSSItem"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:esri="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client"
            esri:GraphicsLayer.MapTipHideDelay="00:00:01.5"    mc:Ignorable="d"
    xmlns:divtools="clr-namespace:Divelements.SilverlightTools;assembly=Divelements.SilverlightTools">

         <Border BorderBrush="#FF99BBE8" BorderThickness="2" Background="White" CornerRadius="8,8,8,8" Opacity=".8">
            <Grid>
                           
            <Grid.RowDefinitions>
                <RowDefinition Height="*"></RowDefinition>
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0">
0 Kudos
DominiqueBroux
Esri Frequent Contributor
How do you initialize the maptip of your layers?

Jennifer's question is important : 'Do all layers share the same maptip?'

Be sure you create a new maptip by layer.
0 Kudos
DarkoRadiceski
New Contributor II
This is the piece of code:

void g_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
        {
            Graphic g = sender as Graphic;
            GeoRSSItem maptip = new GeoRSSItem();
            Binding bindingTitle = new Binding("[" + "Title" + "]");
            maptip.labelTitle.SetBinding(TextBlock.TextProperty, bindingTitle);

            //maptip.hyperlinkButtonTitle.SetBinding(HyperlinkButton.ContentProperty, bindingTitle);

            Binding bindingLink = new Binding("[" + "Link" + "]");
            maptip.hyperlinkButtonTitle.SetBinding(HyperlinkButton.NavigateUriProperty, bindingLink);

            Binding bindingSummary = new Binding("[" + "Summary" + "]");
            DescriptionConverter descriptionConverter = new DescriptionConverter();
            bindingSummary.Converter = descriptionConverter; //assigning the description converter

            maptip.labelHiddenLogic.SetBinding(Label.ContentProperty, bindingSummary);

            g.MapTip = maptip;

            //GraphicsLayer.SetMapTipHideDelay(maptip, new TimeSpan(0,0,1)); -- this has been moved to XAML
        }
0 Kudos