我在ios应用程序中使用ArcGIS地图。我在将地图加载到mapView时遇到问题。我从以前存储的数据库中获取地图信息,我试图加载我存储在数据库中的地图。但不幸的是,它们没有加载,我已经打印了地图信息,并在控制台中检查了数据是否来自数据库,但没有加载。这是我的代码,用于从数据库中调用以前保存的地图,
presenter?.prepareTripDataAndShowOnMap(tripInfo)
我已经打印了tripInfo,它将在控制台中显示
BCTripInfo(id: "333764BC-427A-404E-8209-59BB18E79148", name: "tripe", ownerId: "test@bcnavxe.com", isPinned: true, status: bcnavxe.BCTripInfoStatus.notDownloaded, timestamp: 2018-07-23 11:35:04 +0000, trekFolder: "g")
这就是我从数据库中获取地图信息的方式,
static func get(fromTripInfo tripInfo: BCTripInfo, completionHandler: @escaping (BCTrip?) -> Void) {
guard let tripDatabase = BCDatabaseMaster.shared.tripDatabasePool.getTripDatabase(withTripId: tripInfo.id) else {
completionHandler(nil)
print(tripInfo.id)
return
}
tripDatabase.inDatabase({ database in
do {
guard let tripEntity = try BCTripEntity.getTrip(inDatabase: database, withTripInfo: tripInfo) else {
completionHandler(nil)
return
}
let tripGeometryEntities = BCGeometryRepositoryImpl.getAll(inDatabase: database, fromTripInfo: tripInfo)
let trip = BCTripMapper.toTrip(fromTripEntity: tripEntity, andGeometryEntities: tripGeometryEntities)
completionHandler(trip)
} catch {
completionHandler(nil)
}
}) { error in completionHandler(nil) }
}
} 现在如何在mapView上加载地图?