|
POST
|
You can create a different instance of LayerCollection, copy the current LayerCollection on your Map and bind to that for ItemSource instead. In this solution, you will still need to do stuff or extra handling on this LayerCollection in code-behind. You're right Element Binding with Map as element and Layers as Path for this case will not work because you need to remove the layer from the map if you needed it excluded in your listbox.
... View more
10-21-2010
05:32 AM
|
0
|
0
|
2338
|
|
POST
|
Maybe this? http://help.arcgis.com/en/arcims/10.0/mainhelp/topics/admin_publishing.htm I have not created a any service on my own, sorry I can't help there. This might help too http://help.arcgis.com/EN/arcgisserver/10.0/apis/rest/index.html
... View more
10-21-2010
05:21 AM
|
0
|
0
|
1138
|
|
POST
|
I don't see anything wrong with your solution, if it works for you. While most people prepare to use Binding to a collection for their ItemsSource, you can also add items to your ListBox in code-behind.
... View more
10-21-2010
05:16 AM
|
0
|
0
|
2338
|
|
POST
|
The Editor supports GraphicsLayer too. If you choose to use FeatureLayer, you will need an editable feature service. I'm not sure what other MXD settings are necessary. You can probably check the feature service in the sample and view it in the browser to get an idea of what it would look like. Yes you will need at least ArcGIS API for SL/WPF v2.0, but there were bug fixes in v2.1 regarding Snapping. If you can use v2.1 beta, RC is coming up soon. You will then need ArcGIS Server 10 and also SL 4. As far as SL4 and VS 2008 compatibility, here's a link to MS forum http://forums.silverlight.net/forums/p/178873/402929.aspx. We use VS 2010 though.
... View more
10-21-2010
05:07 AM
|
0
|
0
|
1138
|
|
POST
|
I don't see much documentation about it. http://msdn.microsoft.com/en-us/library/system.windows.interactivity.targetedtriggeraction.targetnameproperty(v=Expression.40).aspx TargetName is inherited from its Base class, TargetedTriggerAction. I googled and found most people put in the name of the element, which makes sense. I don't know if anyone has created action where the target is not an element of that page. I think this is related and it was resolved, you guys can probably exchange solutions: http://forums.arcgis.com/threads/14380-Expand-Collapse-a-toolbar
... View more
10-20-2010
11:02 PM
|
0
|
0
|
525
|
|
POST
|
Sure. In your XAML, class definition is x:Class="SilverlightApplication2.MainPage" which means MainPage() constructor should exist. But your code-behind does not match what your XAML expects. public partial class SubLayerList : UserControl { public SubLayerList() { ... If you replace SubLayerList in code-behind with MainPage, your code should work. I think the problem is VisualStudio is not able to pair your XAML with a partial class definition, therefore fails to call InitializeComponent(). And in code-behind since you were accessing MyMap, VisualStudio tries to find where MyMap has been defined.
... View more
10-20-2010
10:35 PM
|
0
|
0
|
514
|
|
POST
|
No problem. We learn a lot from the forum too 🙂 You missed: private ObservableCollection<FeatureLayer> layers = new ObservableCollection<FeatureLayer>();
... View more
10-20-2010
07:29 PM
|
0
|
0
|
1534
|
|
POST
|
Visual Studio 2008 Expression Blend 3 Silverlight 3 ESRI Silverlight API 1.2
... View more
10-20-2010
02:03 PM
|
0
|
0
|
782
|
|
POST
|
Sure, you can look at this sample: http://help.arcgis.com/en/webapi/silverlight/2.1/samples/start.htm#EditToolsAutoSave Notice that the map has attached properties SnapKey and SnapDistance, the Editor uses this. If you activate the EditVertices button, key down on S while moving a vertex, it will snap to other vertices on another feature other than itself. If SnapKey or SnapDistance is not set, they get default by values (Ctrl, 15) as in the EditorWidget sample in our SDK http://help.arcgis.com/en/webapi/silverlight/2.1/samples/start.htm#ToolkitEditorWidget.
... View more
10-20-2010
01:59 PM
|
0
|
0
|
1138
|
|
POST
|
Are you using Binding? I would do something like this: In MainPage.xaml:
<local:WidgetControl x:Name="MyWidget" DataContext="{Binding ElementName=MyMap}"/>
In my WidgetControl (or in your case the UserControl responsible for TOC):
<ComboBox x:Name="MyComboBox" ItemsSource="{Binding Layers}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding ID}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
If MyComboBox existed in MainPage, I would normally write: ItemsSource="{Binding ElementName=MyMap, Path= Layers}" But if I have set the DataContext of the UserControl, and the two elements do not exist in the same page, I can change it to and know that Binding will still be resolved. ItemsSource="{Binding Layers}"
... View more
10-20-2010
01:52 PM
|
0
|
0
|
2249
|
|
POST
|
Hmm I am not aware of any number limitation on editing vertices What happens when it fails to work? Is there a StackTrace or error message from the server? You can try to use Fiddler to see what requests are made during the edit. Can you give us a sample of the geometry that failed to edit? Thanks.
... View more
10-20-2010
12:27 PM
|
0
|
0
|
293
|
|
POST
|
If your ComboBox is named "Layers" with ItemSource bound to ObservableCollection<FeatureLayer> as described in my previous post, you can modify your query this way:
QueryTask queryTask = new QueryTask((Layers.SelectedItem as FeatureLayer).Url);
//... more code here
query.OutFields.Add("*");
That is Layers.SelectedItem is FeatureLayer and is not null, you can grab it's Url. This was just one way to do it, you can have instead an list of url strings in your ComboBox and perform your query against the selected string. Since you don't know what fields that layer will contain and don't want to hard-code it, you can just return all fields by using "*", no need to specify AddRange(new string[]{ "field1", "field2", ...}). I suggested using FeatureLayer incase you wish to see the LayerInfo.Fields before performing the query. You can get these values after the layer has been initialized.
... View more
10-20-2010
10:09 AM
|
0
|
0
|
1534
|
|
POST
|
Try to draw your polygon in clockwise direction instead of counterclockwise or call simplify on the graphic (http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Simplify) before GeometryService.AreaAndLengthsAsync()
... View more
10-20-2010
09:43 AM
|
0
|
0
|
3077
|
|
POST
|
Oh I'm sorry I missed to include that - layers in my sample is of type ObservableCollection<FeatureLayer>.
... View more
10-20-2010
09:08 AM
|
0
|
0
|
1534
|
|
POST
|
I am not able to reproduce this. What I get instead is that the two polygons get activated for editing, which is a bug and will be fixed in the future release. Regarding the NullReference exception, what version are you using? I tried to do the same with the samples from http://esriurl.com/slsdk2. Can you also share a code snippet of how you are adding Editor or EditorWidget to do EditVertices? Thanks.
... View more
10-20-2010
09:01 AM
|
0
|
0
|
575
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-11-2025 01:30 PM | |
| 1 | 06-06-2025 10:14 AM | |
| 1 | 03-17-2025 09:47 AM | |
| 1 | 07-24-2024 07:32 AM | |
| 1 | 04-05-2024 06:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-12-2026
09:38 AM
|