|
POST
|
How about this? I think you need to use l.Graphics after FeatureLayer.UpdateCompleted, where ids is List<int> that contains id's from the related table.
var graphics = from g in l.Graphics
where ids.Contains((int)g.Attributes["OBJECTID"])
select g;
... View more
02-10-2012
05:44 PM
|
0
|
0
|
2210
|
|
POST
|
You can look at the following SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsExplicitSave
<Grid.Resources>
<esri:Editor x:Key="MyEditor"
Map="{Binding ElementName=MyMap}"
LayerIDs="ThreatAreas"
GeometryServiceUrl="http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"
/>
</Grid.Resources>
<Button Command="{Binding Add}" Margin="2" DataContext="{StaticResource MyEditor}"
Content="Add Polygon">
<Button.CommandParameter>
<sys:Int32>10301</sys:Int32>
</Button.CommandParameter>
</Button>
Note that 10301 is a FeatureType from this service: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/2
... View more
02-10-2012
05:32 PM
|
0
|
0
|
503
|
|
POST
|
SetLayerVisibility does not turn off ArcGISTiledMapServiceLayer.Layers visibility: http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer~SetLayerVisibility.html. If you want to do this, you would have to use ArcGISDynamicMapServiceLayer and VisibileLayers: http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer~VisibleLayers.html
... View more
02-10-2012
05:27 PM
|
0
|
0
|
1663
|
|
POST
|
Sure you can use the table URL as your QueryTask.URL, this should return you Attributes but no Geometry would be returned. If Geometry is an Attribute or Field in your table, then you can still zoom to this location. For example MyMap.ZoomTo(g.Attributes["MyLocation"] as Polygon);
... View more
02-09-2012
08:48 AM
|
0
|
0
|
512
|
|
POST
|
Are you using v2.4 or v3.0 Beta 2? I tried to download and use v2.4 and was left with 19 Warnings for obsolete controls (ScaleBar). The error message you get seem related to unblocking the assemblies. When you right-click properties of the zip file, click "Unblock" button before you extract the files. Hopefully that gets you to 19 Warnings, ScaleBar is obsolete and can be replaced with ScaleLine http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Scaleline
... View more
02-09-2012
08:44 AM
|
0
|
0
|
661
|
|
POST
|
I think you can use the following code: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#WmsLayerSimple var l = MyMap.Layers["OtherWMSLayer"] as WmsLayer; l.GetUrl(MyMap.Extent, (int)MyMap.ActualWidth,(int) MyMap.ActualHeight, (a, b, c, d) => { var url = a; });
... View more
02-09-2012
08:36 AM
|
0
|
0
|
801
|
|
POST
|
QueryTask is really a synchronous operation on the server but Silverlight web requests are asynchronous, which means you need ExecuteCompleted event to get the result. http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.QueryTask~ExecuteAsync.html. If you are using WPF, however, you can get FeatureSet from queryTask.Execute. http://help.arcgis.com/en/webapi/wpf/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.QueryTask~Execute.html
... View more
02-07-2012
04:07 PM
|
0
|
0
|
1193
|
|
POST
|
Thank you for reporting this. I was able to reproduce with v2.4 but not in v3.0 Beta 2. For v2.4, you can probably do the following workaround: You can update this SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#QueryWithoutMap
void QueryTask_ExecuteCompleted(object sender, ESRI.ArcGIS.Client.Tasks.QueryEventArgs args)
{
var l = new ArcGISDynamicMapServiceLayer() { Url = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer" };
l.GetDetails(5, (a, b) =>
{
FeatureSet featureSet = args.FeatureSet;
featureSet.Fields = a.Fields;
if (featureSet != null && featureSet.Features.Count > 0)
ResultsJSON.Text = featureSet.ToJson();
else
MessageBox.Show("No features returned from query");
});
}
... View more
02-07-2012
04:01 PM
|
0
|
0
|
450
|
|
POST
|
You can use Editor.Select to perform selection. This will also run a QueryTask in the background and Editor.EditCompleted event should return the affected graphics: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#FeatureLayerSelection, http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsExplicitSave.
<Button Command="{Binding Select}" Margin="2" DataContext="{StaticResource MyEditor}"
CommandParameter="New" Content="New"/>
... View more
02-07-2012
03:18 PM
|
0
|
0
|
1300
|
|
POST
|
When FeatureLayer.IsInitialized=True and FeatureLayer.InitializationFailure==null, FeatureLayer.LayerInfo will have a value. The code from post# 16 (I've attached C# code: XAML and code-behind) should come to your Initialized event handler. Can you check that it does? This is the case where FeatureLayer is not part of Map and is created in code-behind.
... View more
02-07-2012
01:40 PM
|
0
|
0
|
2915
|
|
POST
|
This blog post might help: http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2009/09/21/Deep-linking-to-map-extents.aspx
... View more
02-07-2012
08:41 AM
|
0
|
0
|
514
|
|
POST
|
What version of the API are you using? v2.4 or v3.0 Beta 2? v2.x are still running Silverlight 4. v3.0 is Silverlight 5. Having .NET Framework 4.0 should not have any effect on the application as this is the .NET Framework it supports. Error 503 seems server-side, are you able to hit the REST end point via your web browser?
... View more
02-07-2012
08:37 AM
|
0
|
0
|
639
|
|
POST
|
I assume this Graphic.Insert() and MyFeatureDataGrid.GraphicsLayer = featureLayer, happens in Editor.EditCompleted event? So you would have some code similar to:
editor.EditCompleted += (s, e) =>
{
if (e.Action == Editor.EditAction.Select)
{
foreach (var edit in e.Edits)
{
var g = edit.Graphic;
if (g.Selected)
{
var l = edit.Layer as FeatureLayer;
MyFeatureDataGrid.GraphicsLayer = l;
}
}
}
};
Instead of adding the selected graphic to a new GraphicsLayer and setting FeatureDataGrid.GraphicsLayer with this new layer, use the original FeatureLayer so you can pass to AttachmentEditor.GraphicSource and AttachmentEditor.FeatureLayer on FeatureDataGrid.SelectionChanged event.
... View more
02-07-2012
08:24 AM
|
0
|
0
|
1300
|
|
POST
|
If you want the same symbol applied to the GraphicsLayer, you can set GraphicsLayer.Renderer with this symbol just as in the following SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#FeatureLayerSimple <Grid x:Name="LayoutRoot" Background="White" >
<Grid.Resources>
<esri:SimpleRenderer x:Key="MySimplePointRenderer">
<esri:SimpleRenderer.Symbol>
<esri:SimpleMarkerSymbol Color="#99FF0000"/>
</esri:SimpleRenderer.Symbol>
</esri:SimpleRenderer>
</Grid.Resources>
<esri:Map x:Name="MyMap" WrapAround="True" Extent="-15000000,2000000,-7000000,8000000">
<esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer"
Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
<esri:FeatureLayer ID="MyFeatureLayer"
Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0"
Where="POP1990 > 100000" Renderer="{StaticResource MySimplePointRenderer}"/>
</esri:Map>
... View more
02-07-2012
08:17 AM
|
0
|
0
|
1195
|
|
POST
|
To add a row to your table, you simply add Graphic to your FeatureLayer. This is an example for adding to this table: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/1
private void Button_Click(object sender, RoutedEventArgs e)
{
var g = new Graphic();
g.Attributes["sf_311_serviceoid"] = 21467;
g.Attributes["agree_with_incident"] = (Int16) 1;
g.Attributes["DateTime"] = DateTime.UtcNow;
g.Attributes["cient_ip"] = "unknown";
g.Attributes["notes"] = string.Format("Added - {0} - local time", DateTime.Now);
l.Graphics.Add(g);
}
Another way is to check for Field Type/Length/Domain etc, to decide default value for the field.
private void Button_Click(object sender, RoutedEventArgs e)
{
if (l.LayerInfo != null && l.LayerInfo.Fields != null)
{
var g= new Graphic();
foreach (var f in l.LayerInfo.Fields)
{
//check f.Type, f.Length to decide default value.
g.Attributes[f.Name] = f.Nullable ? null : (f.Type == Field.FieldType.Double ? (object)new double() : string.Empty);
}
}
}
... View more
02-07-2012
08:13 AM
|
0
|
0
|
2915
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 weeks ago | |
| 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 |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|