Unable to Sync PrePlanned Map Area

1919
12
08-18-2021 05:54 PM
RTC
by
New Contributor II

Following the example "ApplyScheduledUpdatesToPreplannedMapAreaViewController" in the arcgis-ios-sdk-samples app, I am having an issue syncing a map. I can download the initial map area and us it without any issues.

The problem:

I try to sync the offline map by using AGSOfflineMapSyncTask and calling the checkForUpdates. No matter what changes are made to the map area in AGOL, the checkForUpdates function returns 'none' It does not recognize that there are updates.

Question:

How do I get the AGSOfflineMapSyncTask.checkForUpdates to recognize that there are updated for the map area?

0 Kudos
12 Replies
Nicholas-Furness
Esri Regular Contributor

Hi. Thanks for the question. Here's what I think is happening.

Scheduled updates are pre-packaged downloads of changes that are created on the server at an interval determined by the web map's owner (perhaps once a day, at 6am, in preparation for mobile users to start their day with all the updates from the previous 24 hours). So, if you make changes to the web map, there will only be scheduled updates available for download after the next scheduled packaging (in the above example, this would be after 6am). In your case, I'm guessing that the next scheduled packaging hasn't happened yet, so Runtime won't see an update when you call checkForUpdates (remember, that just checks for packaged up scheduled updates).

The scheduled updates enhancement to preplanned maps was created to help large mobile workforces efficiently keep their offline maps up to date, but scheduled updates only provide a read-only offline map experience. This page covers scheduled updates in more detail.

If you want to immediately pick up changes made in the preplanned web map, you will need to modify your code to not opt in to the scheduled update workflow and just do a regular sync.

Hope that helps.

RTC
by
New Contributor II

Hi,

I'm not sure why this was marked as a solution. The information was helpful but it did not solve the issue. I do not get any updates no matter what the time interval is set to so no solution have been discovered. I also removed the scheduled update enhancement but still no updates are downloaded.

0 Kudos
Nicholas-Furness
Esri Regular Contributor

My mistake. I noticed your reply was marked as a solution and figured you must have picked that instead of mine. Thanks for correcting this.

0 Kudos
RTC
by
New Contributor II

Hello Nicholas,

Thank you for your reply, this is helpful! I did try several tests where I set the update time to a future date/time and then tried to sync the map after that future time but still got the same "none" reply when calling checkForUpdates.

QUESTIONS:

1) Is there a minimum time interval for the updates? For example if I make changes to the map area in AGOL and then set the update time to several hours in the future, should that trigger an update or is there a 24 hour minimum?

2) Would changing the map area's bounds (reshape the area) trigger an update or will only changes to data trigger an update for sync?

3) The Esri example in "ApplyScheduledUpdatesToPreplannedMapAreaViewController" in the arcgis-ios-sdk-samples app assumes the mapview has the map loaded and accessible. Is there an example or best practice for syncing multiple preplanned maps when they are not in use, potentially as a background task?

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Hi RTC.

Glad that helped. For your other questions:

  1. You don't set a time in the ArcGIS Online interface, merely an interval. I'll have to check to see what the minimum interval is but it seems to be 24 hours through the ArcGIS Online interface and the Python API.
  2. I'll have to check on this.
  3. Absolutely, you would still create an AGSMap object pointing at each already-downloaded offline map (you use the AGSMobileMapPackage to re-open a previously downloaded map, see here) and then create an AGSOfflineMapSyncTask for each AGSMap.

Hope that helps.

0 Kudos
RTC
by
New Contributor II

Hi Nicholas,

In your reply - "You don't set a time in the ArcGIS Online interface" - Can you clarify this. There is a setting for Time in AGOL, can you explain what this time is for?

RTC_0-1629407933558.png

 

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Apologies. I misunderstood your question about changing the update time to trigger a scheduled updates packaging. My mistake (your question was pretty clear!). I'll have to check with the team to see if this would trigger packaging things up, or if there might be some other way (e.g. a REST call).

0 Kudos
RTC
by
New Contributor II

No worries, thank you for looking into this for me!

0 Kudos
RTC
by
New Contributor II

Hi Nicholas,

I still have not been able to get the preplanned map area sync to work. I have tried removing the scheduled updates and just run a manual update but it never seems to download the updates. Any ideas on what the issue could be?

How is the sample "canyonlands" map setup in "ApplyScheduledUpdatesToPreplannedMapAreaViewController" in the arcgis-ios-sdk-samples app? The example seems to work but if I replace the canyonlands map with one of my maps, it never detects an update as being available.

Thanks for you assistance!

0 Kudos