GenerateOfflineMapJob GetResultAsync not giving appropriate response

593
1
09-22-2020 12:16 PM
KavitaPandey
New Contributor II

Hello,

I am trying to download an offline map from my Web Map using the GenerateOfflineMapJob task in my Xamarin Forms project. However, I am facing below two issues, please help me with these :

Code Syn

1. Once the download starts, and if the application goes in background, then because of backgrounding the job download stops, progress changes from 40-50 to direct  100%, but GetResultAsync() status is coming "Succeeded" and it is not returning any error, so how can I identify an error in such scenarios.

2. On my map, I have a few shapefile layers overlayed, and below are two scenarios related to it :

a) If I select features, combine extents of these features using GeometryEngine.CombineExtents  to calculate offline download extent, download  result gives an error related to Vector Tile(my base map in web map) ( error message e.g. VectorTile_118: For input string: "{"xmin":-12696158.575750671”)

b) If I select all feature layers full extent  as offline download extent   GeometryEngine.CombineExtents(SBUMapView.Map.OperationalLayers.Select(x => x.FullExtent)), it gets downloaded successfully.

What is the cause of error in the first case?

package version in use - Esri.ArcGISRuntime.Xamarin.Forms (100.7.0 ) 

Please help me with these issues.

Thanks in Advance.

0 Kudos
1 Reply
MichaelBranscomb
Esri Frequent Contributor

Hi,

1. Once the download starts, and if the application goes in background, then because of backgrounding the job download stops, progress changes from 40-50 to direct  100%, but GetResultAsync() status is coming "Succeeded" and it is not returning any error, so how can I identify an error in such scenarios.

You can use the GenerateOfflineMapResult.HasErrors Property to determine if there are any errors.

It does sound like there may be an error during the offline map generation because the status goes directly to 100%.

We do recommend though that when you app may be backgrounded you use the following APIs to handle this scenario:

Job(T).Pause Method 

Job(T).ToJson Method 
GenerateOfflineMapJob.FromJson Method 

Job(T).Start Method (note this will resume if it was in progress)

Job(T).CheckStatusAsync Method 

2. On my map, I have a few shapefile layers overlayed, and below are two scenarios related to it :

a) If I select features, combine extents of these features using GeometryEngine.CombineExtents to calculate offline download extent, download result gives an error related to Vector Tile(my base map in web map) ( error message e.g. VectorTile_118: For input string: "{"xmin":-12696158.575750671”)

Is it possible the union/combination of the extents of all features is greater that the full extent of the basemap?

Also, it may be worth checking the spatial references.

Thanks

Mike  

0 Kudos