Endless zoom on offline basemap with tiled layer

2743
9
Jump to solution
10-31-2018 01:14 AM
MichaelMoor
New Contributor II

Hi there!

with the 10.2.5 SKD we found a solution to zoom in more than there are Level of Details defined for the TiledLayer.

// Set the maximum zoom level.
mapView.maxScale = mapView.scale(forResolution: 0.002)
mapView.minScale = 250000
self.currentBaseMap?.maxScale = mapView.scale(forResolution: 0.002)
self.currentBaseMap?.minScale = 250000

you can see the resulting screenshot attached. it looks ugly but does the job for our customers.

In the last 3 month we migrated to 100.4

even if i managed to zoom in indefinitely with that code:

mapView.map?.maxScale = 0

mapView.map?.minScale = 0

the basemap does not resample after reaching the maximum Level of Details.

how do i achive the same result as with the old SDK?

Thank you very much!

Cheers,

Mike

0 Kudos
1 Solution

Accepted Solutions
Nicholas-Furness
Esri Regular Contributor

Note that technically you just need to set maxScale. It's a combination of 3 things.

  1. You should set maxScale = 0 on the AGSMap to ensure that Runtime will allow your app to zoom in all the way.
  2. You should set maxScale = 0 on the layer to ensure that Runtime will display the layer even beyond its original declared scale range as you zoom in. (Set minScale if you also want it displayed all the way as you zoom out.)
  3. In this case, a Tiled Layer, you should set the noDataTileBehavior to .upSample to ensure the layer is drawn with the best available tile even if there is not specific tile for the map scale as you zoom in.

There was a bug in Runtime 100.x which meant that layers with some tiling schemes would fail to display beyond the level that tiles had been created even if you set maxScale = 0. This was fixed at 100.5.

Thanks for your help in reproducing this, Mike.

Nick.

View solution in original post

0 Kudos
9 Replies
DiveshGoyal
Esri Regular Contributor

can you try setting the max scale to 1 (instead of 0)

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Have you tried setting the AGSArcGISTiledLayer.noDataTileBehavior to .upSample?

0 Kudos
MichaelMoor
New Contributor II

Thanks Divesh and Nicholas! Unfortunately it didn't work . The basemap still disappears when zooming in. Any other hints? 

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Hey Michael Moor,

Sorry for the late reply. Could you share the basemap layer you're using? Is it a public one (one of our Imagery basemaps perhaps?)‌.

And could you clarify what you mean by "the basemap does not resample after reaching the maximum Level of Details" - what behavior are you seeing?

Cheers,

Nick.

0 Kudos
MichaelMoor
New Contributor II

Hi Nick,

it's a private self-created basemap. i created a Xcode Project which demonstrates the behavior.

The project is in a private Github repo. I added you (nixta) as collaborator.

Thank you!

Mike

Nicholas-Furness
Esri Regular Contributor

Thanks. I will take a look. Might take a couple of days before I am able to get around to it.

Nick.

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Hi Michael,

As per my DM, were you able to verify this is fixed in 100.5?

Thanks,

Nick

0 Kudos
MichaelMoor
New Contributor II

For all who have the same issue this two lines make the magic happen:

let tiledLayer = AGSArcGISTiledLayer(url: basemapUrl)
tiledLayer.noDataTileBehavior = .upSample
tiledLayer.maxScale = 0
tiledLayer.minScale = 0
let map = AGSMap(basemap: AGSBasemap(baseLayer: tiledLayer))

Thanks Nick for your help!!!

Nicholas-Furness
Esri Regular Contributor

Note that technically you just need to set maxScale. It's a combination of 3 things.

  1. You should set maxScale = 0 on the AGSMap to ensure that Runtime will allow your app to zoom in all the way.
  2. You should set maxScale = 0 on the layer to ensure that Runtime will display the layer even beyond its original declared scale range as you zoom in. (Set minScale if you also want it displayed all the way as you zoom out.)
  3. In this case, a Tiled Layer, you should set the noDataTileBehavior to .upSample to ensure the layer is drawn with the best available tile even if there is not specific tile for the map scale as you zoom in.

There was a bug in Runtime 100.x which meant that layers with some tiling schemes would fail to display beyond the level that tiles had been created even if you set maxScale = 0. This was fixed at 100.5.

Thanks for your help in reproducing this, Mike.

Nick.

0 Kudos