Feature templates are missing with Editor Widget and Template Picker

4159
11
04-25-2012 09:56 PM
Labels (1)
MatthewBrown1
Occasional Contributor
Hi,

I am trying to edit a local feature service with the pre-release ArcGIS Runtime SDK for WPF and the feature templates for the two packages I???m using aren't visible. The MPKs are optimised for the Runtime. They also open ok in ArcMap and I can see the feature templates. However, when I run my C# project, there is a small circle where the templates should be. I can edit the existing features (e.g. delete them), so the feature service and editor seem ok.

One thing that is confusing me is that the online help includes the GeometryServiceUrl for local editing, but the offline samples installed with the SDK do not.

Have I missed a step and is there a way to programmatically create and alter feature templates?

Thanks

I've seen this in the debug output, but not sure if it is related.

System.Windows.Data Error: 40 : BindingExpression path error: 'MaintainAspectRatioEnabled' property not found on 'object' ''EditorWidget' (Name='')'. BindingExpression:Path=MaintainAspectRatioEnabled; DataItem='EditorWidget' (Name=''); target element is 'Editor' (HashCode=43793330); target property is 'MaintainAspectRatio' (type 'Boolean')
0 Kudos
11 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi,

Are you able to share the map package you're using in order that we can test it?

Cheers

Mike
0 Kudos
MatthewBrown1
Occasional Contributor
Hi Mike,

I think I may have solved my problem. Both of my inputs for the MPKs were shapefiles with Z and M values. I used the Copy Features tool to copy one of them to the Default.gdb and disabled Z and M in the environment options. After recreating the MPK, the updated layer now has a feature template and edit geometry is also enabled.

So are .shp files supported as inputs to MPKs? I was hoping to be able to programmatically create MPKs from shapefiles. Also are Z and M values supported? (Not concerned with M, but Z support would be nice.)

Thanks,

Matt
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

Shapefiles are supported as an input to Map Packages for use with the ArcGIS Runtime. When creating the package, if you choose to reference the data the original Shapefile will be referenced on disk and will not get converted. This approach will require the additional vector data format option in the Deployment Builder if you're creating a deployment. If you choose not to reference the the data, the Shapefile will be converted to a File Geodatabase and contained within the package. Additionally, Z and M values are supported with the Prerelease of the ArcGIS Runtime SDK.

If you are still experiencing an issues I'd be keen to test the package you've created.

Cheers

Mike
0 Kudos
MatthewBrown1
Occasional Contributor
Hi Mike,

Still having problems! I started from scratch with new FGDB layers and also started a new C# project. The dynamic map services work ok from the MPKs, but something is not right with the feature services (e.g. one out of two layers are drawn or nothing is drawn if only one layer is added) and the editor widget not showing at all now.

Also get this quite a bit:

ESRI.ArcGIS.Client.Local.LocalServerException was unhandled
  Message=Failed to create service tokanui paddocks gdb MapServer. Service failed to initialize: Error unpacking map package Error code: 500
  Source=ESRI.ArcGIS.Client
0 Kudos
MatthewBrown1
Occasional Contributor
Hi Mike,

Have you been able to replicate my issue on your system?

I thought I would mention that I have replicated my initial problem on another system that is a clean build (I wondered if the upgrade from 10 to 10.1 might have been the cause).

Windows 7 x64 SP1 (fully patched as of yesterday)
VS 2010 SP1
Blend 4 SDK for WPF
ArcGIS Desktop 10.1 Pre-release (ArcEditor)
ArcGIS Runtime SDK 1.0 for WPF Pre-release

I've also checked the logs using the Local Server Utility and there are no obivious errors.
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

I've just tested these both these packages in the latest [daily] build of the ArcGIS Runtime SDK for WPF and they work fine - I had three templates appear in the Template Picker (red and orange polygons from the EMS MPK and outlines from the Paddocks MPK). I've provided my XAML/code below so you can take a look but it's just a copy of the Template Picker sample.

Regarding editing feature templates, you can retrieve these from the layer and edit features programmatically. See this thread for more info: http://forums.arcgis.com/threads/48324-How-to-create-new-feature.


XAML/Code:

    <Grid x:Name="LayoutRoot" Background="White" >
        <Grid.Resources>
            <LinearGradientBrush x:Key="PanelGradient" EndPoint="0.5,1" StartPoint="0.5,0">
                <LinearGradientBrush.RelativeTransform>
                    <TransformGroup>
                        <ScaleTransform CenterY="0.5" CenterX="0.5"/>
                        <SkewTransform CenterY="0.5" CenterX="0.5"/>
                        <RotateTransform Angle="176" CenterY="0.5" CenterX="0.5"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </LinearGradientBrush.RelativeTransform>
                <GradientStop Color="#FF145787" Offset="0.16"/>
                <GradientStop Color="#FF3D7FAC" Offset="0.502"/>
                <GradientStop Color="#FF88C5EF" Offset="0.984"/>
            </LinearGradientBrush>
        </Grid.Resources>
        <esri:Map x:Name="MyMap">
            <esri:ArcGISTiledMapServiceLayer ID="MyLayer" 
                Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
            <esri:ArcGISLocalFeatureLayer ID="EMS" Path="..\..\..\Tokanui EMS GDB.mpk" LayerName="ems" AutoSave="True" Editable="True" OutFields="*"></esri:ArcGISLocalFeatureLayer>
            <esri:ArcGISLocalFeatureLayer ID="Paddocks" Path="..\..\..\Tokanui Paddocks GDB.mpk" LayerName="paddocks" AutoSave="True" Editable="True" OutFields="*"></esri:ArcGISLocalFeatureLayer>     
        </esri:Map>  
        <Border Background="{StaticResource PanelGradient}" BorderThickness="1" CornerRadius="5"
                        HorizontalAlignment="Right"  VerticalAlignment="Top"
                        Padding="5" BorderBrush="Black" Margin="5" >
            <Border.Effect>
                <DropShadowEffect Color="Black" Direction="-45" BlurRadius="20" Opacity=".75" />
            </Border.Effect>
            <esri:TemplatePicker x:Name="MyTemplatePicker" Map="{Binding ElementName=MyMap, Mode=OneWay}" 
                          Loaded="MyTemplatePicker_Loaded"/>
        </Border>
    </Grid>


   public partial class MainWindow : Window
    {
        public MainWindow()
        {
            // License setting and ArcGIS Runtime initialization is done in Application.xaml.cs.
            InitializeComponent();
        }

        private void MyTemplatePicker_Loaded(object sender, RoutedEventArgs e)
        {
            string[] myLayerIDs = { "EMS", "Paddocks" };
            MyTemplatePicker.LayerIDs = myLayerIDs;
        }
    }


Cheers

Mike
0 Kudos
MatthewBrown1
Occasional Contributor
Hi Mike,

Thanks for the info. I can get it to work if I remove the Z values before creating the MPK. But I'm still having issues when editing layers with Z values. Is there something that I need to do in order to enable 3D editing in the runtime?
0 Kudos
KeithGemeinhart
Occasional Contributor
I can get it to work if I remove the Z values before creating the MPK. But I'm still having issues when editing layers with Z values.


I'm experiencing the same problem with z-value features. Has anyone solved this problem yet?
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

Unfortunately this would appear to be an issue in the LocalFeatureService and is being investigated.

Cheers

Mike
0 Kudos