public override MapImage GetTile(int indexX, int indexY, int level, CancellationToken cancellationToken)
{
MapImage mapImage = new MapImage();
mapImage.MapImageType = MapImageType.Url;
if (tileMatrixIdentifiers == null)
{
mapImage.Url = string.Format(this.Url, tileMatrixs[level].Name, indexY, indexX);
return mapImage;
}
else
{
int index = findMatrixLevel(this.Resolution);
if (index == -1)
{
return null;
}
string name = string.Empty;
if (tileMatrixs != null)
{
name = tileMatrixs[index].Name;
if (!CheckMatrix(name))
{
name = string.Empty;
}
}
else
{
name = tileMatrixIdentifiers[index];
}
//string index = tileMatrixIdentifiers[];
if (string.IsNullOrEmpty(name))
{
return null;
}
else
{
mapImage.Url = string.Format(this.Url, name, indexY, indexX);
return mapImage;
}
}
}