|
POST
|
If you have more than one layer in your Editor (i.e. LayerIDs is not set and Map has more than 1 editable layer and/or LayerIDs is set but with more than 1 layer), Add button will be disabled. You will need to separate the Add editors like so.
<Grid.Resources>
<esri:Editor x:Key="Layer1AddEditor" Map="{Binding ElementName=MyMap}"
LayerIDs="MyFeatureLayerID1"
GeometryServiceUrl="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"/>
<esri:Editor x:Key="Layer2AddEditor" Map="{Binding ElementName=MyMap}"
LayerIDs="MyGraphicsLayerID2"
GeometryServiceUrl="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"/>
</Grid.Resources>
<Button Content="Add" DataContext="{StaticResource Layer1AddEditor}"
Command="{Binding AddParameter}" CommandParameter="MyFeatureTypeID"/>
<Button Content="Add" DataContext="{StaticResource Layer2AddEditor}"
Command="{Binding AddParameter}" CommandParameter="{StaticResource MySymbol}"/>
... View more
04-12-2012
05:06 PM
|
0
|
0
|
879
|
|
POST
|
I believe it's this code: x.ToList(), this creates a different list so you are not affecting the graphic from layer. You can test that before you call layer.SaveEdits(), layer.HasEdits is false. Try to iterate through x instead of x.ToList().
... View more
04-12-2012
04:54 PM
|
0
|
0
|
1149
|
|
POST
|
Can you subscribe to EndSaveEdits and SaveEditsFailed event? Also, you can monitor web requests using Fiddler to see if either save (applyEdits) or update (query) requests failed. You don't need to call Refresh after Update, update will re-draw the layer as it refreshes the GraphicCollection. I could not reproduce with the following code. I am using FeatureDataForm from EditorWidget to update the attribute (Category to Infestation should make fcode == 11001) so on Update click, the feature should disappear from my view. xmlns:esri="http://schemas.esri.com/arcgis/client/2009">
<Grid x:Name="LayoutRoot" Background="White">
<esri:Map x:Name="MyMap">
<esri:ArcGISTiledMapServiceLayer ID="MyLayer"
Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
<esri:FeatureLayer ID="Test" DisableClientCaching="True" OutFields="*" AutoSave="False" Where="fcode != 11001"
Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/0">
<esri:FeatureLayer.MapTip>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ItemsControl ItemsSource="{Binding Keys}" Grid.Column="0" />
<ItemsControl ItemsSource="{Binding Values}" Grid.Column="1" />
</Grid>
</esri:FeatureLayer.MapTip>
</esri:FeatureLayer>
</esri:Map>
<StackPanel VerticalAlignment="Top" HorizontalAlignment="Center">
<Button Content="Update" Click="Button_Click"/>
<esri:EditorWidget Map="{Binding ElementName=MyMap}"
/>
</StackPanel>
</Grid>
private void Button_Click(object sender, RoutedEventArgs e)
{
var l = MyMap.Layers["Test"] as FeatureLayer;
l.Update();
}
... View more
04-07-2012
09:49 PM
|
0
|
0
|
1149
|
|
POST
|
I just verified that appending FeatureLayer.Token to the attachment URI should be enough.
... View more
04-07-2012
09:12 PM
|
0
|
0
|
2189
|
|
POST
|
The symbol used for snapping is not exposed and therefore not customizable.
... View more
04-07-2012
09:08 PM
|
0
|
0
|
646
|
|
POST
|
If you are using Flex Viewer, please post your question to: http://forums.arcgis.com/forums/111-ArcGIS-Viewer-for-Flex. If you are using Flex API: http://forums.arcgis.com/forums/18-ArcGIS-API-for-Flex. This forum is for ArcGIS API for Silverlight. Although Flex API have same property on ArcGISDynamicMapServiceLayer http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/ArcGISDynamicMapServiceLayer.html#visibleLayers, we target a different technology so code will be different. It is best to post your question there.
... View more
04-07-2012
09:06 PM
|
0
|
0
|
2227
|
|
POST
|
<HyperlinkButton Content="{Binding Name}" NavigateUri="{Binding Uri}"
VerticalAlignment="Center" TargetName="_blank">
When you create AttachmentEditor.Style, the highlighted code above is missing token. The correct Uri should be appended with "<AttachmentInfo.Uri>?token=<FeatureLayer.Token"
... View more
04-03-2012
09:52 AM
|
0
|
0
|
2189
|
|
POST
|
If you want to bind to ElementLayer.Children, I think the following code should work:
xmlns:local="clr-namespace:Sprint20"
xmlns:esri="http://schemas.esri.com/arcgis/client/2009">
<Grid x:Name="LayoutRoot" Background="White">
<Grid.Resources>
<esri:Envelope x:Key="MyEnvelope" XMin="-117" YMin="34" XMax="-117" YMax="34"/>
<local:MyUIElements x:Key="MyElementLayerChildren">
<!--Clickable button-->
<Button x:Name="RedlandsButton" Width="20" Height="20" Content="X"
esri:ElementLayer.Envelope="{StaticResource MyEnvelope}"
VerticalAlignment="Center" HorizontalAlignment="Center" />
<!--Arrow pointing at Copenhagen from the right-->
<TextBlock Text="<=" HorizontalAlignment="Right"
FontSize="15" Foreground="Blue" FontWeight="Bold"
esri:ElementLayer.Envelope="12.5698,55.6765,12.5698,55.6765" />
<!--Arrow pointing at Copenhagen from the left-->
<TextBlock Text="=>" HorizontalAlignment="Left"
FontSize="15" Foreground="Blue" FontWeight="Bold"
esri:ElementLayer.Envelope="12.5698,55.6765,12.5698,55.6765" />
<!-- Red box - No size specified. Envelope guides the size -->
<Rectangle Fill="Red" esri:ElementLayer.Envelope="0,0,10,10" />
<!--Editable textbox-->
<TextBox Width="100" Height="20" esri:ElementLayer.Envelope="40,0,40,0"
Text="Editable text" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
</local:MyUIElements>
</Grid.Resources>
<esri:Map x:Name="MyMap">
<esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer"
Url="http://services.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer"/>
<esri:ElementLayer Children="{Binding Source={StaticResource MyElementLayerChildren}}"/>
</esri:Map>
</Grid>
This local class will allow you to create an instance of ObservableCollection type.
public class MyUIElements : ObservableCollection<UIElement>
{
public MyUIElements() { }
}
... View more
04-03-2012
08:48 AM
|
0
|
0
|
1093
|
|
POST
|
ArcGISDynamicMapServiceLayer cannot show maptips because no features are on the client, what you get from this layer is just an image. You can however use IdentifyTask on the same URL and display result using InfoWindow. The following SDK samples will help: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Identify http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#InfoWindowSimple
... View more
04-02-2012
05:17 PM
|
0
|
0
|
428
|
|
POST
|
ElementLayer.Children is of type ObservableCollection<UIElement>. So in your code, you want just one child ItemsControl? Each child must specify its location through esri:ElementLayer.Envelope. Was your code snippet working for you? Are you getting errors? If you are using Silverlight5, you can debug XAML code and see if the binding statements are resolved.
... View more
04-02-2012
05:13 PM
|
0
|
0
|
1093
|
|
POST
|
Cool. I'm glad that worked for you. You can use ChildWindow as in Post# 5 & 7 from this related thread: forums.arcgis.com/threads/43088-Insert-new-feature-in-a-feature-service-layer-via-a-geocode-result. This is essentially the same code TemplatePicker run when ShowAttributesOnAdd is true.
... View more
04-02-2012
05:03 PM
|
0
|
0
|
887
|
|
POST
|
In XAML, you can then use your Envelope class that wrapped the API Envelope class instead. <local:MyEnvelope XMin="{Binding xmin}" .../>
... View more
04-02-2012
04:59 PM
|
0
|
0
|
805
|
|
POST
|
Unfortunately, Envelope is not a DependencyObject or it does not implement INotifyPropertyChanged, which makes these properties not support binding. You can however wrap it around another class that implements INotifyPropertyChanged. Maybe something like this:
public class MyEnvelope : INotifyPropertyChanged
{
private Envelope envelope;
private Envelope Envelope
{
get
{
if (envelope == null)
envelope = new Envelope();
return envelope;
}
}
public double XMin
{
get { return Envelope.XMin; }
set
{
if (Envelope.XMin != value)
{
Envelope.XMin = value;
OnPropertyChanged("XMin");
}
}
}
//more code
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string property)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(property));
}
}
... View more
03-31-2012
05:45 PM
|
0
|
0
|
805
|
|
POST
|
If you want the OK button to close your window, you can do this:
var fdf = new FeatureDataForm() { FeatureLayer = layer, GraphicSource = graphic};
var window = new ChildWindow() { Content = fdf };
fdf.EditEnded += (a, b) =>
{
window.Close();
};
window.Show();
... View more
03-31-2012
05:27 PM
|
0
|
0
|
2326
|
|
POST
|
ElementLayer.Envelope is an Attached property and therefore support binding. It expects value of type Envelope. You can try the following code:
xmlns:esri="http://schemas.esri.com/arcgis/client/2009">
<Grid x:Name="LayoutRoot" Background="White">
<Grid.Resources>
<esri:Envelope x:Key="MyEnvelope" XMin="-117" YMin="34" XMax="-117" YMax="34"/>
</Grid.Resources>
<esri:Map x:Name="MyMap">
<esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer"
Url="http://services.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer"/>
<esri:ElementLayer>
<esri:ElementLayer.Children>
<!--Clickable button-->
<Button x:Name="RedlandsButton" Width="20" Height="20" Content="X"
esri:ElementLayer.Envelope="{Binding Source={StaticResource MyEnvelope}}"
VerticalAlignment="Center" HorizontalAlignment="Center"/>
</esri:ElementLayer.Children>
</esri:ElementLayer>
</esri:Map>
</Grid>
... View more
03-31-2012
05:16 PM
|
0
|
0
|
1093
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 3 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
|