OK, here is my symbol.<esri2:SimpleMarkerSymbol x:Key="DefaultMarkerSymbol" Color="Aqua" Style="Circle" />
and here is my map and layer with the bindings commented out.<esri:ArcGISDynamicMapServiceLayer ID="ConstructionProjects"
Url="http://gismaps.pagnet.org/ArcGIS/rest/services/Interactive_TIP_2011/MapServer"
VisibleLayers="1,2" >
</esri:ArcGISDynamicMapServiceLayer>
<esri:GraphicsLayer ID="MapTipGraphicsLayer">
<esri:GraphicsLayer.MapTip>
<Border esri:GraphicsLayer.MapTipHideDelay="00:00:01.5" CornerRadius="10" BorderBrush="#FF222957" BorderThickness="3" Margin="0,0,15,15">
<Border.Background>
<LinearGradientBrush EndPoint="1.038,1.136" StartPoint="0.015,0.188">
<GradientStop Color="#FFD1DFF2"/>
<GradientStop Color="#FF092959" Offset="0.946"/>
</LinearGradientBrush>
</Border.Background>
<Border.Effect>
<DropShadowEffect ShadowDepth="10" BlurRadius="14" Direction="300" />
</Border.Effect>
<StackPanel Orientation="Vertical" Margin="20,15,20,15">
<StackPanel Orientation="Horizontal" Margin="0,0,0,6">
<TextBlock Text="TIP ID: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="12" />
<!--<TextBlock Text="{Binding [TIP_ID]}" Foreground="#FFFFFFFF" FontSize="12" FontStyle="Italic" FontFamily="Portable User Interface" />-->
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Name: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="12" />
<!--<TextBlock Text="{Binding [ST_NAME]}" Foreground="#FFFFFFFF" FontSize="12" FontStyle="Italic" FontFamily="Portable User Interface" />-->
</StackPanel>
</StackPanel>
</Border>
</esri:GraphicsLayer.MapTip>
</esri:GraphicsLayer>
Here is the code behind. #region MapTip
void MyMap_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == "SpatialReference")
{
MapTipGraphicsLayerLoad();
MyMap.PropertyChanged -= MyMap_PropertyChanged;
}
}
void MapTipGraphicsLayerLoad()
{
ESRI.ArcGIS.Client.Tasks.Query query = new ESRI.ArcGIS.Client.Tasks.Query()
{
Geometry = new ESRI.ArcGIS.Client.Geometry.Envelope(-180, 0, 0, 90),
OutSpatialReference = MyMap.SpatialReference
};
query.OutFields.Add("*");
QueryTask queryTask = new QueryTask("http://gismaps.pagnet.org/ArcGIS/rest/services/Interactive_TIP_2011/MapServer/1");
queryTask.ExecuteCompleted += MapTipGraphicsLayerQueryTask_ExecuteCompleted;
queryTask.ExecuteAsync(query);
}
void MapTipGraphicsLayerQueryTask_Failed(object sender, ESRI.ArcGIS.Client.Tasks.QueryEventArgs queryArgs)
{
MessageBox.Show("Failed") ;
}
void MapTipGraphicsLayerQueryTask_ExecuteCompleted(object sender, ESRI.ArcGIS.Client.Tasks.QueryEventArgs queryArgs)
{
if (queryArgs.FeatureSet == null)
return;
FeatureSet resultFeatureSet = queryArgs.FeatureSet;
ESRI.ArcGIS.Client.GraphicsLayer graphicsLayer =
MyMap.Layers["MapTipGraphicsLayer"] as ESRI.ArcGIS.Client.GraphicsLayer;
if (resultFeatureSet != null && resultFeatureSet.Features.Count > 0)
{
foreach (ESRI.ArcGIS.Client.Graphic graphicFeature in resultFeatureSet.Features)
{
graphicFeature.Symbol = LayoutRoot.Resources["DefaultMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
graphicsLayer.Graphics.Add(graphicFeature);
}
}
}
#endregion
I know the attempt to catch the failed query is wrong. I couldn't figure out how to "subscribe" to the query failed or mouse enter events. I suspect the problem may be the geometry envelope since I don't know how or what values belong in there. I am not able to get any of the code to fire for the query, nothing pops up etc. Hopefully this will help someone spot my problem. 🙂