Select to view content in your preferred language

Layer not loading, custom TiledLayer implementation

909
0
07-22-2016 10:26 AM
MichelleArmstrong
Deactivated User

I have written a custom tile layer class that extends TiledLayer, using Esri.ArcGISRuntime Desktop API for .NET, version 10.2.7.0.

I'm trying to test the implementation in a single layer on a single map in a single map view:

            Map myMap = new Map();
            CustomTilesLayer newLayer= new CustomTilesLayer();
            myMap.Layers.Add(newLayer);
            MyMapView.Map = myMap;

When I run the application, I can see that the OnInitializeTiledLayerRequestedAsync() method of CustomTilesLayer is being called and returns a task, but it never invokes the task and I don't know why.  The application displays a blank white map with the Esri logo.

If I instead try to load the layer asynchronously:

await newLayer.InitializeAsync();

the application hangs on the await command.  Again, the task is not invoked (and the blank white map with the Ersi logo still displays).

Here's the method:

protected override Task<TiledLayerInitializationInfo> OnInitializeTiledLayerRequestedAsync()
{
        return new Task<TiledLayerInitializationInfo>(InitializeTileInfo);
}

(As written in the custom class, the task invokes a private method InitializeTileInfo() that creates tile initialization information about the scaling and extent, etc.)

Any ideas why the task is not invoked?

Also, currently my tile layer class has an empty constructor.  Is there something else that needs to be defined in my tile layer class?

Tags (2)
0 Kudos
0 Replies