2

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.

Parv Bhasker
  • 1,773
  • 1
  • 20
  • 39

1 Answers1

-1

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.

Alessandro Verona
  • 1,157
  • 9
  • 23
  • I am just fetching layers using url and showing them on map. And only want to show those layer data when map is offline – Parv Bhasker May 11 '18 at 08:53
  • Ok, first of all, your service should be enabled for offline use (https://developers.arcgis.com/ios/latest/swift/guide/create-an-offline-map.htm). Then in your client you should autenticate with your arcgis account and then you can download the map: https://developers.arcgis.com/ios/latest/swift/guide/create-an-offline-map.htm#ESRI_SECTION2_831BD55058F9482BA5A01EEF5697BC71 . I suggest you to play with arcgis sample projects. – Alessandro Verona May 11 '18 at 09:23
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/19698021) – Pradeep May 11 '18 at 09:55
  • @pradeep ok, now I do as you suggested. This is a general question and I provided a general answer. I worked with arcgis mobile map in past and belive me, to have the right links and the right resources is a great startint point. I changed my answer with the hot points. – Alessandro Verona May 11 '18 at 10:00
  • thanks it really helped me to understand the concept, Just want to ask a quick question. Do we need to login "AGSPortal.arcGISOnline(withLoginRequired: true)" to download the geodatabase ? – Parv Bhasker May 11 '18 at 12:48
  • I'm not sure at all but in my experience I say that you should have a login. For me the login was mandatory :\ I think you cannot have offline map without login and get the token from arcgis – Alessandro Verona May 11 '18 at 14:00
  • If your map uses an Esri basemap, you will need to log in to take that offline (Esri's basemaps need a login to track offline usage). Otherwise, it depends on whether the layers in your web map are public. And as @Saret mentioned, they of course need to be enabled for offline use. – Nixta May 12 '18 at 20:41
  • 1
    Note also that if you're using the Offline Map Task you don't need to separately use the Geodatabase Sync Task if the WebMap you use for the Offline Map Task contains the layers you need. For synchronizing you can then just use the Offline Map Sync Task. – Nixta May 12 '18 at 20:48