Offline Basemap Disappears after zooming in

732
3
12-02-2021 03:00 PM
by Anonymous User
Not applicable

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

 

0 Kudos
3 Replies
Nicholas-Furness
Esri Regular Contributor

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.

0 Kudos
Nicholas-Furness
Esri Regular Contributor

@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.

0 Kudos
MarkBockenhauer
Esri Regular Contributor

@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.

0 Kudos