I have a graphic layer that loads on startup of a application (points). This graphic layers some maptips associated with it. Basically I have a lot of points loading like 5000 but only a few load maybe 500. Is there a setting to restrict the amount of graphics to load?thankshere's my c# code behind
void MyMap_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == "SpatialReference")
{
LocsGraphicsLayerLoad();
Map.PropertyChanged -= MyMap_PropertyChanged;
}
}
void LocsGraphicsLayerLoad()
{
ESRI.ArcGIS.Client.Tasks.Query query = new ESRI.ArcGIS.Client.Tasks.Query()
{
Geometry = new ESRI.ArcGIS.Client.Geometry.Envelope(-180, 0, 0, 90),
OutSpatialReference = Map.SpatialReference
};
query.OutFields.Add("*");
// Return geometry with result features
query.ReturnGeometry = true;
QueryTask queryTask = new QueryTask("http://machineserver1/ArcGIS/rest/services/Graphics/MapServer/1");
queryTask.ExecuteCompleted += LocsGraphicsLayerQueryTask_ExecuteCompleted;
queryTask.ExecuteAsync(query);
}
void LocsGraphicsLayerQueryTask_ExecuteCompleted(object sender, ESRI.ArcGIS.Client.Tasks.QueryEventArgs queryArgs)
{
if (queryArgs.FeatureSet == null)
return;
FeatureSet resultFeatureSet = queryArgs.FeatureSet;
ESRI.ArcGIS.Client.GraphicsLayer graphicsLayer =
Map.Layers["LocsGraphicsLayer"] 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["MapTipMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
graphicsLayer.Graphics.Add(graphicFeature);
}
}
}
And then in my xaml I have
<esri:GraphicsLayer ID="LocsGraphicsLayer">
<esri:GraphicsLayer.MapTip>
<Border BorderBrush="DarkGray" CornerRadius="13" BorderThickness="1" Margin="0,0,15,15">
<Border.Effect>
<DropShadowEffect ShadowDepth="10" BlurRadius="14" Direction="300" />
</Border.Effect>
<Border CornerRadius="10" Background="#DDFFEEEE" BorderThickness="5" BorderBrush="#77FF0000">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" Margin="10">
<StackPanel Orientation="Horizontal">
<TextBlock Text="TYPE: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="10" VerticalAlignment="Center"/>
<TextBlock Text="{Binding [STRUCTURENAME]}" HorizontalAlignment="Left" VerticalAlignment="Center" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="OBJECT ID: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="10" VerticalAlignment="Center" />
<TextBlock Text="{Binding [FEATUREID]}" HorizontalAlignment="Left" VerticalAlignment="Center" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="PRIORITY: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="10" VerticalAlignment="Center" />
<TextBlock Text="{Binding [RANK]}" HorizontalAlignment="Left" VerticalAlignment="Center" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="LONG ID: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="10" VerticalAlignment="Center"/>
<TextBlock Text="{Binding [STRUCTUREID]}" HorizontalAlignment="Left" VerticalAlignment="Center" />
</StackPanel>
</StackPanel>
</Border>
</Border>
</esri:GraphicsLayer.MapTip>
</esri:GraphicsLayer>