Custom ServiceImageTiledLayer zoom visibility

3519
10
07-23-2018 01:47 AM
OliverBoesche
New Contributor II

Hello,

for our software we had to implement an own ServiceImageTiledLayer foreach level of detail/ zoom levels. Therefore each tiles layer consist of a tile cache with only the top zero layer and not all detail layers in one cache. Hope that this is clear enough. Through our constraints it is not possible to put them all together in one custom layer instance.

The standard MapView behaviour is to make them visible and invisible on the different zoom levels according to an unknown decision metric based on resolution and scale from the LevelOfDetail. That works so far, if we add the caches in a sorted order according to the resolution of each cache. But then we see some problems to display them correctly to our requirements. I try to use practical words to avoid missunderstandings in the words. Please tell me if something isn't clear enough.

Problems:

  • Caches are automatically made invisible which allows gaps between the LoDs
    • IsVisibleOnScale is true for the whole zoom range
    • IsVisible is always on true
  • Min/MaxScale on a ServiceImageTiledLayer has no effect in this scenario

The desired behaviour:

  • Fully zoomed out => the topmost cache shall be visible
  • Fully zoomed in => the lowermost cache shall be visible
  • Between two overlapping caches the lower one shall be displayed

So, my question would be if it is possible to solve this issues or to work around them? Otherwise is there a behaviour specification for this layer visibility or can we handle this ourselve?

Thanks for all help.

Best regards,

Oliver

0 Kudos
10 Replies
dotMorten_esri
Esri Notable Contributor

The desired behavior you're describing should be how tiled layers works.

It's not clear to me what the problem you're having is, or why the existing tiled layers doesn't do what you need.

0 Kudos
OliverBoesche
New Contributor II

Hi Morton,

I agree, this is also my understanding. In our scenario, we have foreach level of detail an instance of a derived ServiceImageTiledLayer. I will call it CustomTiledCache from now on. So these CustomTiledCaches have only one level of detail within, but all together represent a standard tiled cache behaviour. The reason why is simple. We share these data structures with another program and can't change it. The problem we have there is the minimal different extent for each level of detail.

As an example we have maps in 100k, 50k and 10k scale loadet and there are zoom steps showing no map between two caches. We couldn't fix this, because of the implemented visibility automatic from the MapView,Renderer, or whatever controls it.

I hope this gives a better view on the problem?

Best regards,
Oliver

0 Kudos
OliverBoesche
New Contributor II

Excuse me, for the annoying postings, but we need a solution for the problem as soon as possible.

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

Are you able to provide the code and data that reproduces the problem? (Geonet has a 10MB upload limit - you can email mbranscomb@esri.com with details of a download location, or to request an online folder share)

If you're not able to provide the code and data, we'll need to understand more details:

- To which layer collection are you adding the tiled layers? (e.g. Map.Basemap.BaseLayers)

- What are the properties for the MinScale, MaxScale, and TileInfo for each layer you have?

Cheers

Mike

0 Kudos
OliverBoesche
New Contributor II

Thanks to everyone who can help or offered help.

I have to apologize for the late reply. We are very busy at the moment.

I added a demo of the problem to my first post and hope that makes it more clear to you.

The demo is a little and rapidly build application of our problems and is so far not polished.

To creat it we use Visual Studio 2017, .Net Framework 4.6.1 and nuget.org.

 

The application itself creates four tile caches based on our existing map material which I can’t provide.

  • The maps have an approximate scale ration of 1:250K, 1:100K, 1:50K and 1:1m and are not completely congruent.
  • For  a better viewing of the map, you should add the dark gray canvas background map. I used a .tpk file,

because we have some proxy issues to get it from the Esri servers.

  • The tiles overlapping the extents. Thas true, because we normally have there transparent areas.
  • The layer update mechanism is a construct to prevent upper visible layers to hide the layer below according to the zoom level.
  • The MinScale and MaxScale is used but has no effect at all. Visibillity is controlled by the map view.

 

Please let me know if we do something wrong in the code,  you have improvements for us or something has to be explained in more detail.

 

Thanks a lot.

0 Kudos
OliverBoesche
New Contributor II

Any news for me?

0 Kudos
dotMorten_esri
Esri Notable Contributor

I've been looking at your reproducer (thanks for that), and I'm a little confused. If you only want to one "cache" at a time, why aren't you just using a single custom layer and direct the file URIs to the correct "cache" based on the LOD that's requested in GetTileUriAsync ?

0 Kudos
OliverBoesche
New Contributor II

We use different caches for each level, because the extent of each cache differs a bit and we are in a situation where we can't change the tile format/structure.

You can see that they are not congruent when you zoom into the map in the reproducer. The extents of the caches are from a real example.

Thanks for investigating.

0 Kudos
dotMorten_esri
Esri Notable Contributor

> We use different caches for each level, because the extent of each cache differs a bit

Just set an extent that encompasses all of the extents.

Also set 'myTiledLayer.NoDataTileBehavior = NoDataTileBehavior.Blank;' to prevent upsampling of higher-level LODs and only show a single LOD at the same time.

0 Kudos