Hi,
Sometimes my shapefile layers is not shown on the map when i run my method below.
The first row with the Delay solves the problem. But is there another way to do it? Because i dont want to do the delay.
public async Task drawShapeFileAsync()
{
await Task.Delay(2000);
ArrayList shpFiles = layersSingleton.getShpLayers();
for (int i = 0; i < shpFiles.Count; i++)
{
ShpLayer shpLayer = (ShpLayer)shpFiles[i];
string filepath = workingDirectory + "\\\\" + shpLayer.fileName;
ShapefileFeatureTable shapefileFeatureTable = await ShapefileFeatureTable.OpenAsync(filepath);
FeatureLayer featureLayer = new FeatureLayer(shapefileFeatureTable);
featureLayer.RenderingMode = FeatureRenderingMode.Dynamic;
await MyMapView.Map.LoadAsync();
MyMapView.Map.OperationalLayers.Add(featureLayer);
}
}
Any input would be appreciated.
Thanks, Mattias