Geometry editing by using Editor

836
5
01-10-2012 09:57 AM
weiliang
New Contributor II
Hi,

I try to use the Editor to edit my feature layer (already versioned), but when I run the website, all the Editor related button are greyed out. Is there any thing I did wrong? What I did is:

1) Add an Editor to the Grid resources:
<esri:Editor x:Key="EditWellPadPolygon" Map="{Binding ElementName=MyMap}"  LayerIDs="WetlandsDelinationArea"  GeometryServiceUrl="http://gis.ursbtr.com/ArcGIS/rest/services/Geometry/GeometryServer"  />

2) Add the Feature layer to the map layers:
<esri:FeatureLayer ID="WetlandsDelinationArea" ProxyUrl="../proxy.ashx"  Url="http://ourwebsite.com/ArcGIS/rest/services/Project/EcologyMobileProjects/FeatureServer/6"   AutoSave="True"  ValidateEdits="True" DisableClientCaching="True" Mode="OnDemand"  Opacity="0.8"  Visible="False" OutFields="*"  InitializationFailed="MapServices_InitializationFailed"/>

3) Add an editing panel with all the buttons:
                      <StackPanel x:Name="editSP" Orientation="Vertical" VerticalAlignment="Stretch" DataContext="{StaticResource EditWellPadPolygon}">
                        <Button Command="{Binding Add}" Content="1. Add New Record" ToolTipService.ToolTip="" Margin="14,0,14,5">
                            <Button.CommandParameter>
                                <sys:Int32>10101</sys:Int32>
                            </Button.CommandParameter>
                        </Button>
                        <Grid >
                            <Rectangle RadiusX="4" RadiusY="4" Margin="7,1,7,1" Stroke="Olive"></Rectangle>
                            <StackPanel Orientation="Vertical" VerticalAlignment="Stretch">
                                <Button Command="{Binding Select}" CommandParameter="New" Content="2. Select a Record to Delete" Margin="14,8,14,8"/>
                                <Button Command="{Binding ClearSelection}" Content="Clear Selection"  Margin="28,2,14,8" Visibility="Collapsed"/>
                                <Button Command="{Binding DeleteSelected}" Content="Delete Selected Record" Margin="28,2,14,8" Visibility="Collapsed"/>
                            </StackPanel>
                        </Grid>
                        <Button Command="{Binding EditVertices}" Content="3. Change a Record Shape" Margin="14,5,14,5"/>
                    </StackPanel>

Thanks,

Wei
0 Kudos
5 Replies
ChristopherHill
Occasional Contributor
As far as I can tell everything looks fine, only thing you didn't provide is the map tag so that I confirm you named your map correctly.  <esriMap x:Name="MyMap" >. Is editing allowed on the service? Could you paste the entire mainpage.xaml.
0 Kudos
weiliang
New Contributor II
Thanks for your reply, Christopher. I found the problem it that I set the feature layer, which should be visible, as invisible.

Wei
0 Kudos
ChristopherHill
Occasional Contributor
Yes, didn't see that. It will detect only visible layers.
0 Kudos
Jitendrudulacaraju
New Contributor
In the ADD binding, do you set the command property to 'Editor.ADD' ? I want some reference code for adding a new feature in the feature class.

Hi,

I try to use the Editor to edit my feature layer (already versioned), but when I run the website, all the Editor related button are greyed out. Is there any thing I did wrong? What I did is:

1) Add an Editor to the Grid resources:
<esri:Editor x:Key="EditWellPadPolygon" Map="{Binding ElementName=MyMap}"  LayerIDs="WetlandsDelinationArea"  GeometryServiceUrl="http://gis.ursbtr.com/ArcGIS/rest/services/Geometry/GeometryServer"  />

2) Add the Feature layer to the map layers:
<esri:FeatureLayer ID="WetlandsDelinationArea" ProxyUrl="../proxy.ashx"  Url="http://ourwebsite.com/ArcGIS/rest/services/Project/EcologyMobileProjects/FeatureServer/6"   AutoSave="True"  ValidateEdits="True" DisableClientCaching="True" Mode="OnDemand"  Opacity="0.8"  Visible="False" OutFields="*"  InitializationFailed="MapServices_InitializationFailed"/>

3) Add an editing panel with all the buttons:
                      <StackPanel x:Name="editSP" Orientation="Vertical" VerticalAlignment="Stretch" DataContext="{StaticResource EditWellPadPolygon}">
                        <Button Command="{Binding Add}" Content="1. Add New Record" ToolTipService.ToolTip="" Margin="14,0,14,5">
                            <Button.CommandParameter>
                                <sys:Int32>10101</sys:Int32>
                            </Button.CommandParameter>
                        </Button>
                        <Grid >
                            <Rectangle RadiusX="4" RadiusY="4" Margin="7,1,7,1" Stroke="Olive"></Rectangle>
                            <StackPanel Orientation="Vertical" VerticalAlignment="Stretch">
                                <Button Command="{Binding Select}" CommandParameter="New" Content="2. Select a Record to Delete" Margin="14,8,14,8"/>
                                <Button Command="{Binding ClearSelection}" Content="Clear Selection"  Margin="28,2,14,8" Visibility="Collapsed"/>
                                <Button Command="{Binding DeleteSelected}" Content="Delete Selected Record" Margin="28,2,14,8" Visibility="Collapsed"/>
                            </StackPanel>
                        </Grid>
                        <Button Command="{Binding EditVertices}" Content="3. Change a Record Shape" Margin="14,5,14,5"/>
                    </StackPanel>

Thanks,

Wei
0 Kudos
JenniferNery
Esri Regular Contributor
0 Kudos