Select to view content in your preferred language

Saving edits to local feature layers

2480
7
05-13-2013 06:53 AM
Labels (1)
NigelMacLucas1
Emerging Contributor
I have a program which loads a tile pack for the base layer, then a bing layer and then a map pack with 3 layers which are added individualy.

            <esri:ArcGISLocalTiledLayer ID="BaseMap" Path="..\\data\\maps\\localtest.tpk"/>
            <bing:TileLayer ID="BingLayerAerial" LayerStyle="AerialWithLabels" Token="token here"/>
            <esri:ArcGISLocalFeatureLayer ID="Sites" Path="..\\data\\maps\\features.mpk" LayerName="Sites" AutoSave="True" Editable="True" OutFields="Type, Name" DisableClientCaching="True"/>
            <esri:ArcGISLocalFeatureLayer ID="Routes" Path="..\\data\\maps\\features.mpk" LayerName="Routes" AutoSave="True" Editable="True" OutFields="Type, Name" DisableClientCaching="True"/>
            <esri:ArcGISLocalFeatureLayer ID="Areas" Path="..\\data\\maps\\features.mpk" LayerName="Areas" AutoSave="True" Editable="True" OutFields="Type, Name" DisableClientCaching="True"/>

I have then added an editor so changes can be made.

This all works fine, changes persist when the project is restarted. When I load the map pack onto another computer the changes haven't been saved.

Is there a command to write the changes to the local map pack or export them to a shape file for review on another computer?

Nigel
0 Kudos
7 Replies
MatthewBrown1
Deactivated User
Hi Nigel,

When you load a map package in the Runtime (v10.1.1) it extracts all the files included to a directory e.g. C:\Users\user\AppData\Local\ArcGISRuntime\Documents\ArcGIS\Packages. (This path is different from v1.0.) You can browse to this directory with ArcGIS Desktop and view the feature classes.

However, it sounds like you might want to look into referencing your data (instead of including it in the MPK file). Take a look at point number 8 here http://resources.arcgis.com/en/help/runtime-wpf/concepts/index.html#//01700000005t000000.
0 Kudos
NigelMacLucas1
Emerging Contributor
Hi,

Thanks for the quick reply.

I tried referencing all data before. This worked on the development computer but when I moved the map pack to another computer it couldn't find any of the features layers in the file. It loads the layers but without any data on them. Not sure what I did wrong but the only way I could get it to work was to untick reference all data box.

Nigel
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

When the Package references the data it uses an absolute path and therefore the path on the deployment machine needs to be the same as the machine used to create the map package (you can use mapped drives to recreate the same path on each machine).

However, the current editing workflow is somewhat restrictive and therefore we're working on a richer edit synchronization framework which will allow you to download features from a feature service, edit those features offline and then sync back with the service once you're online. It will also support more manual desktop checkout/checkin workflows, but with the absolute/relative path issues you've noted.

Cheers

Mike
0 Kudos
NigelMacLucas1
Emerging Contributor
Does the map pack need to be created in a folder with a path accessable from either computer, ie c:\data. The computer this will be running will be offline so network drives aren't an option here.
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

Yes, it needs to be a path accessible on both machines. You could consider creating a virtual drive (e.g. using Subst command) which could be, for example, X: and which points to wherever the data is on the authoring machine and the deployment machine.

However, as I said, we're working to resolve these absolute path issues.

Cheers

Mike
0 Kudos
MatthewBrown1
Deactivated User
Hi Mike,

Are these changes coming in the 10.2 release? We are using flash drives to deploy and have had issues with drive mapping - it is hard to find one that consistently isn't being used as we are working across a dozen or so government entities and private companies. We had some joy running a WMI script, but not ideal.
0 Kudos
NigelMacLucas1
Emerging Contributor
With a bit of expermintation I have found out that you can use a relative path for the map pack as long as the you create a file based geodatabase which holds the source files and it is in the same the same path ie c:\data on all computers. You can then copy the geodatabase about with the changes from computer to computer.

Nigel
0 Kudos