|
POST
|
parameters.Add(new GPFeatureRecordSetLayer("Draw_Polygon", args.Geometry)); It's not working because you are using the GPFeatureRecordSetLayer constructor which is creating the recordset from only one geometry. There is another constructor taking a FeatureSet as argument:
parameters.Add(new GPFeatureRecordSetLayer("Draw_Polygon", new FeatureSet(
(Map.Layers["MyGraphicsLayer"] as GraphicsLayer).Graphics
)));
... View more
01-05-2011
04:29 AM
|
0
|
0
|
898
|
|
POST
|
In case this could help, here is a legend style using only itemscontrols (2 imbricated itemscontrols, one for layer items, one for legend items) <Style x:Key="ItemsControl" TargetType="esriToolkit:Legend">
<Setter Property="LayerItemsMode" Value="Flat" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="esriToolkit:Legend">
<ScrollViewer Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}"
>
<ItemsControl ItemsSource="{TemplateBinding LayerItemsSource}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<!--Layer Item-->
<ContentPresenter Content="{Binding}" ContentTemplate="{Binding Template}" />
<!--Legend Items-->
<ItemsControl ItemsSource="{Binding LegendItems}" >
<ItemsControl.ItemTemplate>
<DataTemplate >
<ContentPresenter Content="{Binding}" ContentTemplate="{Binding Template}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsPresenter/>
</ItemsControl>
</ScrollViewer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
... View more
01-05-2011
02:25 AM
|
0
|
0
|
2215
|
|
POST
|
I confirm that the message is localized based on what language Silverlight was installed in.
... View more
01-04-2011
05:46 AM
|
0
|
0
|
994
|
|
POST
|
I..don't want the tree view that comes with the Legend control. If you set to 'Flat' the LayerItemsMode of the legend control, you won't see any group layers or map services item in the legend. But even in Flat mode the default legend template is using a tree view (with only 2 levels one for the layer items, one for the swatches). Then if you need advanced customization, you can retemplate the legend control with any items control you want.
... View more
01-04-2011
05:29 AM
|
0
|
0
|
1851
|
|
POST
|
Additionaly to the LayerIds property mentionned by Erike, you can dynamically remove legend items in the legend refreshed event. For example if you don't want to see any GraphicsLayer, you can add this code: private void Legend_Refreshed(object sender, Legend.RefreshedEventArgs e)
{
if (e.LayerItem.Layer is ESRI.ArcGIS.Client.GraphicsLayer)
MyLegend.LayerItems.Remove(e.LayerItem);
}
You can obviously extend this sample by using another criteria than the layer type : for example a custom attached property.
... View more
01-04-2011
05:21 AM
|
0
|
0
|
2758
|
|
POST
|
At this time, there is no out-of-the-box support for labelling a feature layer but you can create your own symbols (see custom symbols sample) and add a TextBlock in these symbols binded to any attribute of your graphic:
<TextBlock Text="{Binding Attributes[MyLabel]}" />
... View more
01-04-2011
05:02 AM
|
0
|
0
|
648
|
|
POST
|
So can I change the values of PrintableArea.Height and PrintableArea.Width? You can't change the printable area size. This one is depending on the printer, the paper size and the orientation. So you have to adapt the map size to the printable area size. In this thread, you will find ideas on how to print the current map. Another option is to clone the current map in order to keep live the current map and to display a print preview at the same time : sample.
... View more
01-04-2011
02:55 AM
|
0
|
0
|
585
|
|
POST
|
Okay its working now! Thanks for the info, you pointed us in the right direction You are welcome:). We have the same problem. We haven't installed SP1 yet but the legend control works with services created on 9.3.1 but does not work with services created on 10. Any idea why this is so? But we do plan to install SP1 later today and check it out. There should not be any difference between 9.3.1 and 10 services. Both are using the arcgis.com legend service but this can work with public services only. From 10SP1, the map service includes its own legend service.
... View more
01-04-2011
02:37 AM
|
0
|
0
|
1851
|
|
POST
|
all the tasks seem to be kicking off by using the DrawEventArgs args complete call. It's a good way to execute the task when this one is expecting a polygon or a polyline as input. But there are also samples executing the task on the mouse_click event. You can execute the task at any time as soon as your input parameters are ready. I was wondering can the tasks take more than one input ...more than one poly,line, or point? Yes you can define multiple input parameters. If your number of input geometry is not defined you can also consider to use a FeatureSetLayer as input.
... View more
01-04-2011
02:31 AM
|
0
|
0
|
898
|
|
POST
|
Does the layer have to be public if you have 10 sp 1? No, it should work with private service. If you request your map service, you should see a Legend hyperlink (e.g. http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_MedianIncome_US_2D/MapServer). By clicking this Legend Hyperlink, you should see the legend defined by your service (e.g http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_MedianIncome_US_2D/MapServer/legend). Is this working with your service?
... View more
01-03-2011
09:02 AM
|
0
|
0
|
1851
|
|
POST
|
Please, in your browser, send a request to the Feature layer rest end point (e.g. http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_MedianIncome_US_2D/MapServer/0) and share the result. This might give a clue in your issue.
... View more
01-03-2011
04:19 AM
|
0
|
0
|
651
|
|
POST
|
Unfortunately I didn't find out any way to add items dynamically. My best suggestion is you to manage your own toolbar which is basically a panel with buttons inside.
... View more
01-03-2011
04:06 AM
|
0
|
0
|
481
|
|
POST
|
Are you working with an ArcGISDynamicMapServiceLayer or with Feature Layers? If it's an ArcGISDynamicMapServiceLayer, you can check the map server URL (e.g. http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_MedianIncome_US_2D/MapServer) and test the 'Export Map' operation. If it's a FeatureLayer, you can also check the FeatureLayer rest end point (e.g. http://services.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_MedianIncome_US_2D/MapServer/0). This might give a clue about the issue.
... View more
01-03-2011
03:55 AM
|
0
|
0
|
1669
|
|
POST
|
Code creating the same legend control than in the sample you pointed out: public LegendWithTemplates()
{
InitializeComponent();
LayoutRoot.Children.Add(CreateLegend());
}
Legend CreateLegend()
{
var legend = new Legend
{
LayerIDs = new[] { "Points of Interest", "United States" },
LayerItemsMode = Legend.Mode.Tree,
ShowOnlyVisibleLayers = false,
Height = 300, Width = 200,
HorizontalAlignment = HorizontalAlignment.Right,
VerticalAlignment = VerticalAlignment.Top,
Margin = new Thickness(20)
};
legend.SetBinding(Legend.MapProperty, new Binding {ElementName = "MyMap"});
legend.Refreshed += Legend_Refreshed;
legend.MapLayerTemplate = CreateTemplate(@"
<StackPanel Orientation=""Horizontal"">
<CheckBox Content=""{Binding Label}""
IsChecked=""{Binding IsEnabled, Mode=TwoWay}""
IsEnabled=""{Binding IsInScaleRange}"" >
</CheckBox>
<Slider Maximum=""1"" Value=""{Binding Layer.Opacity, Mode=TwoWay}"" Width=""50"" />
</StackPanel>");
legend.LayerTemplate = CreateTemplate(@"
<CheckBox Content=""{Binding Label}""
IsChecked=""{Binding IsEnabled, Mode=TwoWay}""
IsEnabled=""{Binding IsInScaleRange}"" >
</CheckBox>");
return legend;
}
static DataTemplate CreateTemplate(string template)
{
return (DataTemplate)System.Windows.Markup.XamlReader.Load(@"<DataTemplate xmlns=""http://schemas.microsoft.com/client/2007"">" + template + "</DataTemplate>");
}
... View more
01-03-2011
03:44 AM
|
0
|
0
|
1048
|
|
POST
|
You could use a proxy server and set the ProxyUrl property to this server.
... View more
01-02-2011
11:04 PM
|
0
|
0
|
1155
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-12-2025 03:01 AM | |
| 1 | 10-14-2025 09:24 AM | |
| 1 | 06-13-2013 09:22 AM | |
| 1 | 04-29-2022 02:21 AM | |
| 1 | 04-29-2022 02:28 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-30-2025
08:06 AM
|