|
POST
|
I think the issue with a MMPK would be that you couldn't edit and sync the feature data.
... View more
01-18-2017
04:28 AM
|
0
|
1
|
1326
|
|
POST
|
Just to clarify, you can't download a "package" (tile and feature) all at once. You'll have to get one first, check the result, and then get the other. Once both are downloaded, this will create the "package" you need to use when offline.
... View more
01-17-2017
03:07 PM
|
0
|
2
|
1326
|
|
POST
|
Are you certain the layers are getting added to the map. The offline layers may have a different name, so if you are using a text string the load the layer, rather than iterating around all feature layers in the offline geodatabase, this may be your issue. You could also just open the geodatabase to confirm that records are present. If your extent or something was hosed, maybe you have an empty geodatabase.
... View more
01-17-2017
03:04 PM
|
0
|
0
|
1246
|
|
POST
|
GenerateGeodatabaseParameters and ExportTileCacheParameters allow you to set the map extent for the export. GenerateGeodatabaseParameters Class And ExportTileCacheParameters Class
... View more
01-17-2017
03:01 PM
|
0
|
0
|
1326
|
|
POST
|
I have not seen a Socket exception. Are you seeing it when adding the layer to the map or when setting up your sync task? Share a snippet of code which exhibits the issue and it will make it easier offer suggestions.
... View more
01-17-2017
07:02 AM
|
0
|
8
|
1770
|
|
POST
|
Ok, there must be something else in the app/code/setup that is causing an issue since it worked on the first try for me. But without seeing more code not sure what else to suggest. Please post your solution once you figure it in case others can benefit from your struggles. Email me offline if you want to share code to try to figure this out. chad_yoder@yahoo.com
... View more
01-13-2017
04:16 AM
|
0
|
13
|
1770
|
|
POST
|
Post the latest code you are using and I'll take a look. It worked using the code I sent earlier. Did you try that code?
... View more
01-13-2017
03:02 AM
|
0
|
15
|
1770
|
|
POST
|
Has you map been activated before you try to get the VisibleArea.Extent? For example, if you initially load a different page other than the map page, then this will give you null. If you load the map page, then this will be set. That is the only time I've seen it be null. Hope this helps.
... View more
01-12-2017
12:44 PM
|
0
|
17
|
3480
|
|
POST
|
I did a quick test and was able to download the geodatabase. Give the code I sent a try. If you are using layer, give the geodatabase model a try.
... View more
01-12-2017
12:20 PM
|
0
|
19
|
3480
|
|
POST
|
When you run the test, are you using the Geodatabase sync model instead of the layer? The code shows both, so just wondering what you are using. Anything special in the service? I'll try to wire it up in my code and see if it works.
... View more
01-12-2017
12:12 PM
|
0
|
1
|
3480
|
|
POST
|
Instead of using generateGdbJob.Start(), try using: //Get the result var gdb = await gdbJob.GetResultAsync(); Where gdb is the Geodatabase object. The error seems to hint it's something with the job. Did you try calling the function I provided? If that works, you could refactor for your needs.
... View more
01-12-2017
10:49 AM
|
2
|
23
|
3480
|
|
POST
|
This code works for me in v. 100. You'll have to change some of the things used in other classes, but hopefully it helps. The map extent passed into this function is EsriMapView.VisibleArea.Extent. /// <summary> /// Generates the offline gdb. /// </summary> /// <returns>The offline gdb.</returns> public static async Task<Geodatabase> GenerateOfflineGdbAsync(string mapName, Envelope mapExtent) { try { //Get the feature service and load it var url = await ConfigurationManager.GetSyncServiceUrlAsync (); //Create the task and get the default parameters var gdbSyncTask = await GeodatabaseSyncTask.CreateAsync (new Uri (url)); var gdbParameters = await gdbSyncTask.CreateDefaultGenerateGeodatabaseParametersAsync(mapExtent); gdbParameters.AttachmentSyncDirection = AttachmentSyncDirection.Bidirectional; gdbParameters.ReturnAttachments = true; gdbParameters.SyncModel = SyncModel.Geodatabase; //Get the path and generate the geodatabase string gdbPath = Path.Combine (ConfigurationManager.AppDataDirectory, mapName); gdbPath = PathHelpers.CleanPath (gdbPath); if (!System.IO.Directory.Exists(gdbPath)) System.IO.Directory.CreateDirectory(gdbPath); gdbPath = Path.Combine(gdbPath , SettingsManager.GeodatabaseName); //Generate the Gdb and create the callback handler Job<Geodatabase> gdbJob = gdbSyncTask.GenerateGeodatabase (gdbParameters, gdbPath); gdbJob.JobChanged += (object sender, EventArgs evt) => { #if WINDOWS_UWP Debug.WriteLine("[GDB GENERATE STATUS MESSAGE] " + gdbJob.Status.ToString()); #else Console.WriteLine("[GDB GENERATE STATUS MESSAGE] " + gdbJob.Status.ToString()); #endif }; //Get the result var gdb = await gdbJob.GetResultAsync(); //Check the result if (gdb == null) { ToastHelpers.ShowError("Download Error", "Unable to download the selected feature data.\n\nError: " + gdbJob.Error.Message, 7); } else { ToastHelpers.ShowSuccess("Map Data Download", "Successfully downloaded the map data for offline use.", 5); } return gdb; } catch (Exception ex) { ToastHelpers.ShowError("Error", ex.Message, 7); return null; } }
... View more
01-12-2017
05:29 AM
|
0
|
0
|
3480
|
|
POST
|
Also, have you confirmed the TPK file is valid and has data? You could open in ArcMap to make sure you can see the tiles.
... View more
12-30-2016
05:18 AM
|
0
|
0
|
1793
|
|
POST
|
Looks similar to what I have and I'm able to load an offline basemap. This code works for me, maybe has to do with creating a new Basemap? Or, checking the load status to make sure the layer is loaded? //Create a new map EsriMapView.Map = new Map(); //Add the basemap string basemapPath = Path.Combine (model.FullPath, SettingsManager.BasemapName); basemapPath = PathHelpers.CleanPath (basemapPath); if (System.IO.File.Exists(basemapPath)) { var basemapLayer = new ArcGISTiledLayer(new Uri(basemapPath)); if (basemapLayer.LoadStatus == Esri.ArcGISRuntime.LoadStatus.NotLoaded) await basemapLayer.LoadAsync (); EsriMapView.Map.Basemap.BaseLayers.Add(basemapLayer); } You might also want to reload the map, this occurs at the end of my offline map loading: //Load the map await EsriMapView.Map.RetryLoadAsync ();
... View more
12-30-2016
05:17 AM
|
0
|
0
|
1793
|
|
POST
|
Don't think it's possible to get the progress, but you do get events that you can use to notify users of what is going on during the process. //Sync the geodatabase Job<IReadOnlyList<SyncLayerResult>> syncJob = gdbSyncTask.SyncGeodatabase (syncParameters, gdb); syncJob.JobChanged += (object sender, EventArgs evt) => { #if WINDOWS_UWP Debug.WriteLine("[GDB SYNC STATUS MESSAGE] " + syncJob.Status.ToString ()); #else Console.WriteLine ("[GDB SYNC STATUS MESSAGE] " + syncJob.Status.ToString ()); #endif };
... View more
12-29-2016
06:04 AM
|
0
|
3
|
768
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-20-2017 11:09 AM | |
| 1 | 09-22-2017 10:32 AM | |
| 1 | 06-20-2017 07:32 AM | |
| 1 | 04-07-2017 03:32 AM | |
| 3 | 12-19-2019 12:58 PM |
| Online Status |
Offline
|
| Date Last Visited |
03-11-2025
09:48 AM
|