hello!I have problem with my code, I need your help.My XAML is :
<Grid.Resources>
<esri:SimpleMarkerSymbol x:Key="DefaultMarkerSymbol" Color="Red" Size="6" Style="Diamond" />
</Grid.Resources>
<esri:Map x:Name="map1" Background="White" WrapAround="True" Margin="0,22,0,0" Extent="-928323.6071, 502054.310, -295465.584, 1113500.0197" ZoomFactor="2" IsLogoVisible="False" >
<!--Map Layers-->
<esri:ArcGISTiledMapServiceLayer ID="BaseMapLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
<esri:GraphicsLayer ID="MyGraphicsLayer">
<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="Cacao : " FontWeight="Bold" Foreground="#FF0F274E" FontSize="10" VerticalAlignment="Center" />
<TextBlock Text="{Binding [CACAO11_12]}" HorizontalAlignment="Left" VerticalAlignment="Center" />
</StackPanel>
</StackPanel>
</Border>
</Border>
</esri:GraphicsLayer.MapTip>
</esri:GraphicsLayer>
</esri:Map>
in my codebehind is:
void MyMap_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == "SpatialReference")
{
map1.PropertyChanged -= MyMap_PropertyChanged;
_legendGridCollapsed = false;
_classGridCollapsed = false;
LegendCollapsedTriangle.MouseLeftButtonUp += Triangle_MouseLeftButtonUp;
LegendExpandedTriangle.MouseLeftButtonUp += Triangle_MouseLeftButtonUp;
// Set query where clause to include features with an area greater than 70 square miles. This
// will effectively exclude the District of Columbia from attributes to avoid skewing classifications.
ESRI.ArcGIS.Client.Tasks.Query query = new ESRI.ArcGIS.Client.Tasks.Query()
{
Where = "CAFE11_12 > 0 and CACAO11_12 > 0",
OutSpatialReference = map1.SpatialReference,
ReturnGeometry = true
};
query.OutFields.Add("*");
QueryTask queryTask = new QueryTask("http://services1.arcgis.com/yt621kzsRO05k21r/arcgis/rest/services/PRODUCTION_CACAO/FeatureServer/0");
queryTask.ExecuteCompleted += (evtsender, args) =>
{
if (args.FeatureSet == null) return;
_featureSet = args.FeatureSet;
SetRangeValues();
_valeurSetRangeValue = true;
};
queryTask.ExecuteCompleted += queryTask_ExecuteCompleted;
queryTask.ExecuteAsync(query);
CreateColorList1();
CreateThematicList();
}
}
void queryTask_ExecuteCompleted(object sender, QueryEventArgs queryArgs)
{
if (queryArgs.FeatureSet == null)
return;
FeatureSet resultFeatureSet = queryArgs.FeatureSet;
ESRI.ArcGIS.Client.GraphicsLayer graphicsLayer = map1.Layers["MyGraphicsLayer"] 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);
}
}
}
I don't know watch wrong with it ?nothing come