self.portal = AGSPortal (URL: NSURL(string: "https://mtx.maps.arcgis.com")!, loginRequired: false)
self.portal.credential = AGSCredential(user: USERNAME, password: PASSWORD)
//construct a portal item from the portal and item ID string
self.portalItem = AGSPortalItem(portal: self.portal, itemID: ITEMID)
//construct a map from the portal item
self.map = AGSMap(item: self.portalItem)
self.portal.loadWithCompletion() {[weak self] (error) in
if error == nil {
// check the portal item loaded and print the modified date
if self?.portal.loadStatus == AGSLoadStatus.Loaded {
self?.mapView.map = self?.map
}
}
else{
print("The map failed to load. ", error?.localizedDescription)
}
}
A tpk is a tile package, you can create from a raster tiled map service if it supports exporting tiles. Or you can use ArcGIS Pro. A web map could a collection of different layers (tiled layer, map image layer, feature layer etc). If you want to take a web map offline you can look into "mmpk"s or Mobile Map Packages.
This topic might be helpful: Create an offline map—ArcGIS Runtime SDK for iOS | ArcGIS for Developers
Thanks for reply
Can you please tell me how to create mobile map package(mmpk) through ArcGIS online portal ?
Thanks,
Kamal
You will need ArcGIS Pro to create mobile map packages.
1. You can refer to the following link on how to add web map from portal in ArcGIS Pro. Add maps and scenes to a project—ArcGIS Pro | ArcGIS Desktop
2. And once you have the desired data or map in Pro, you can read about exporting it as mobile map package here: Create Mobile Map Package—Data Management toolbox | ArcGIS Desktop
Thanks for the reply
Can you give me the links of raster tiled map service which supports exporting tiles?
Basically, I want to download whole new york city map means I can go any zoom level(zooms in/zoom out) in tpk file in offline mode just like in online mode.
Thanks,
Kamal
Any update on above question??
I am waiting for your reply
Thanks,
Kamal