Hi guys,
I spent 2 days searching an answer if I could combine several map areas in an offline Map. I want to have an offline map of Europe with max scale to regions and detailed map of several cities, which means an opportunity to scale down to building there. So in ArcGISOnline I created 2 map areas for my map - "Europe" with range from world to city and "Berlin" with scale from city to buildings. When I download areas from device and create a package, only the last loaded area is on the map, when I list files in directory used for loading both tpk are there, but package.info and
mobile_map.mmap files only contain data related to last loaded area. I use the following code in kotlin:
val portal = Portal("https://www.arcgis.com/", false)
val portalItem = PortalItem(portal, itemID)
val offlineMapTask = OfflineMapTask(portalItem)
//get all of the preplanned map areas in the web map
val mapAreasFuture = offlineMapTask.preplannedMapAreasAsync
mapAreasFuture.addDoneListener {
try {
// get the list of areas
val mapAreas = mapAreasFuture.get()
val directory = getDirectory()
var i = 0
for (mapArea in mapAreas) {
mapArea.loadAsync()
mapArea.addDoneLoadingListener({
val downloadJob = offlineMapTask.downloadPreplannedOfflineMap(mapArea, directory)
downloadJob.start()
downloadJob.addJobDoneListener({
if (downloadResult.hasErrors()) {
val layerErrors = downloadResult.getLayerErrors()
val tableErrors = downloadResult.getTableErrors()
}
i++
if (i == mapAreas.size) { val offlineMapPackage = MobileMapPackage(directory) offlineMapPackage.addDoneLoadingListener({ if (offlineMapPackage.getLoadStatus() === LoadStatus.LOADED) { System.out.println("Number of maps = " + offlineMapPackage.getMaps().size) mapView.map = offlineMapPackage.getMaps().get(0)
} else { println("PACKAGING FAILED") } })
offlineMapPackage.loadAsync()
}
})
})
}
} catch (e: Exception) {
e.printStackTrace()
}Is it possible at all to do what I want?