// Create a new stretch colorizer definition using default constructor.
StretchColorizerDefinition stretchColorizerDef = new StretchColorizerDefinition();
var rasterLayerCreationParams = new RasterLayerCreationParams(new Uri(url))
{
ColorizerDefinition = stretchColorizerDef,
Name = layerName,
MapMemberIndex = 0
};
await QueuedTask.Run(() =>
{
// Create a raster layer using the colorizer definition created above.
// Note: You can create a raster layer from a url, project item, or data connection.
RasterLayer rasterLayerfromURL =
LayerFactory.Instance.CreateLayer<RasterLayer>(rasterLayerCreationParams, aMap);
});