Hello,
I have created a downloaded map based on a webmap using AGSGenerateOfflineMapJob . Everything works except when I zoom in past the level of detail, the basemap disappears instead of getting more pixelated/blurred. How I can prevent the basemap from disappearing?
Thanks,
Nikholai
Hi @Anonymous User.
You should dig into the AGSMap's basemap and set the noDataTileBehavior maxScale on any image tile layers it contains. Try something like this:
func removeTiledBasemapMaxScale(for map: AGSMap) {
map.load { error in
if let error = error {
// Do whatever error handling you might do in your app here.
print("Error loading map: \(error)")
return
}
map.basemap.baseLayers.forEach {
($0 as? AGSLayer)?.maxScale = 0
}
// Probably also good to set the reference layers.
map.basemap.referenceLayers.forEach {
($0 as? AGSLayer)?.maxScale = 0
}
}
}
You'll want to do this each time you open the map - this won't get persisted to the downloaded map.
@Anonymous User: I've corrected my response above. It was nearly there, but the trick is to set maxScale. The layers should upscale by default. Apologies for the confusion. Let us know how that works for you.
@Anonymous User another option may be to request a .tpkx instead of tpk. A tpkx should draw at all scales regardless of LOD defined in the tiles.