We noticed that if there’s no connection to online service and map is panned exception is drawn correctly as expected. When connection is restored and map is panned those exception are still seen. It will result this kind of view:
Also sometimes it looks like that layer is drawn top of exception when connection is restored and map is panned. (In this case exception was first drawn by OgcApiFeatureLayer and after connection was restored those black lines were drawn top of exception when panning).
Question is that is there something what could by done to re-draw those tiles with exception when connection is restored ? Also why in the second picture exception is still seen although layer is re-drawn after connection is restored ?
BTW, it seems if zoom level is changed those exception will be removed but you need to wait until new zoom level is fully drawn. But if you e.g quickly zoom in/out exceptions are still seen.
These error tiles are marked as drawn_completed, so they will not be updated when panning within the current map extent. To force a refresh, you need to pan the map to a completely different area and then pan back to the original location.
We could also make the error tiles look better by the following code, the error tiles will be blank.
But would it be possible to not mark error tiles as drawn_completed so that those would be redrawn without need for panning to completely different area ?
Tested this with 14.4.4 and like in beta tiles are now re-loaded when map is panned after connection failure.
But I noticed still one minor issue related to this. Problem is that tiles are not stored to cache when they are re-loaded after failure.
Steps to re-produce:
Disconnect network
Pan map to see failed tiles
Connect network
Pan map a bit and tiles failed on step 2 are now re-loaded correctly
Disconnect network
Pan map a bit and tiles failed on step 2 are again shown as failed even those were visible on step 4
=> Tiles are not stored to cache on step 4 from some reason
If on step 4 map is e.g zoomed in/out those problematic tiles are stored to cache. Probably this is somehow related to fact that caching is done on overlay level and maybe those failed tiles are re-loaded on layer level ?
Yes, you could apply a workaround on top of 14.4.4.
Here’s the workaround:
Add 2 new classes: EnhancedLayerTileView and EnhancedLayerOverlay
Replace LayerOverlay with EnhancedLayerOverlay in your code
EnhancedLayerTileView.cs
public class EnhancedLayerTileView: LayerTileView
{
public EnhancedLayerTileView(): this(new Collection<Layer>()) {}
public EnhancedLayerTileView(IEnumerable<LayerBase> layers): base(layers) { }
public void ClearError()
{
this.Error = null;
}
}
EnhancedLayerOverlay.cs
public class EnhancedLayerOverlay: LayerOverlay
{
protected override TileView GetTileCore()
{
return new EnhancedLayerTileView(Layers);
}
protected override void OnDrawnTile(DrawnTileTileOverlayEventArgs args)
{
if (args.DrawnTile is EnhancedLayerTileView enhancedLayersTileView && enhancedLayersTileView.Error !=null)
{
enhancedLayersTileView.ClearError();
}
base.OnDrawnTile(args);
}
}
Thanks for the workaround. Since 14.4.5 will be released so soon I think that we can wait for that and use 14.4.4 while waiting for 14.4.5. But anyway it’s good to know that workaround exist if this cache related bug causes some major issue on our side.