ThinkGeo.com    |     Blog    |     Wiki    |     Support

How to use the DrawingProgress

Hello!
I am trying to use the DrawingProgressChanged for WmtsLayer on Xamarin Forms, however it never seems to fire.
I want to know when my map has finished drawing, so that some code can be ran.
I use it like the code below. Is this the correct usage?

       WmtsLayer wmtsLayer = new WmtsLayer(new[] { new Uri("http://opencache3.statkart.no/gatekeeper/gk/gk.open_wmts") }); //
        wmtsLayer.ActiveLayerName = "topo2";
        wmtsLayer.ActiveStyleName = "default";
        wmtsLayer.WmtsSeverEncodingType = WmtsSeverEncodingType.Kvp;
        wmtsLayer.TileMatrixSetName = "EPSG:32632";          
        wmtsLayer.OutputFormat = "image/jpeg";
        wmtsLayer.DrawingProgressChanged += WmtsLayer_DrawingProgressChanged;
        
        layerOverlay = new LayerOverlay();
        layerOverlay.TransitionEffect = TransitionEffect.Stretch;
        
        layerOverlay.TileCache = new FileBitmapTileCache(@"/mnt/sdcard/MapSuiteSampleData/TileCaches/", "topo2_cache_wmts");
        layerOverlay.Layers.Add("wmtslayer", wmtsLayer);

}

private void WmtsLayer_DrawingProgressChanged(object sender, DrawingProgressChangedEventArgs e)
{
//Do something
}

Hi Jehans,

The DrawingProgressChanged event is not supported by the wmtsLayer, because this layer is a network based layer, it request data from internet.

In fact we have two events is related with this work.

  1. layerOverlay.Drawn, it will be fired multiply times if you select the type TileType.MultipleTile
  2. map.OverlaysDrawn

If you found any problem or have any question about this please let us know.

Regards,

Don

Thank you Don, that makes sense.
Have a nice day!

Hi Jehans,

I am glad to hear that’s helpful, any question please let us know.

Regards,

Don