Search code examples
iosswiftofflinearcgis-runtime

ArcGis Runtime 100 save layers to access them offline


I am working on Arcgis runtime 100 sdk and I have some layers urls provided by client. For now I'm using these url's to to create an AGSLayer and add in the operations layers of map to show it on screen. Its working great till now.

Now I want to save these layers and their data. so to make user access the map offline.

I went through the Arcgis guids. But i am not sure i understand anything there. And I didnt find any appropriate solution for this

Please help me out.


Solution

  • You can follow this example. GenerateOfflineMapViewController.swift

    //instantiate offline map task
    self.offlineMapTask = AGSOfflineMapTask(portalItem: self.portalItem)
    

    Use the AGSOfflineMapTask to take maps offline. The sample creates a portal item object using a web map’s ID. This portal item is used to initialize an AGSOfflineMapTask object.

    Can you specify what mean "Now I want to save these layers and their data" ? You also need to edit the map? If yes this is called redlining

    A feature collection provides a way of grouping logically-related feature collection tables. Redlining information (called "Map Notes" in ArcGIS Online), for example, may contain points, lines, polygons, and associated text to describe things in the map.

    Also remember that your services should be enabled for offline use. Client side you will need to create a GeoDatabase

    Obtain a job to generate and download the geodatabase by passing the AGSGenerateGeodatabaseParameters to the generateJob method on the AGSGeodatabaseSyncTask. Run the job to generate and download the geodatabase to the device.