arnaudleclerc / AzureMapsControl.Components

Razor Components for azure-maps-control
MIT License
34 stars 12 forks source link

MediaLayerOptions 'Opacity' needs floating point value #98

Closed bfenwick806 closed 3 months ago

bfenwick806 commented 4 months ago

In the MediaLayerOptions class there is a property Opacity which is defined as integer. At the moment this makes it impossible to specify the opacity of an Image Layer when adding one to the map as all values are rounded to the nearest integer. When used to create an ImageLayer it actually requires a floating point value between 0 and 1 to be passed down through the eventual JSInterop call, necessitating that the property in the class should supporting floating point values.

public abstract class MediaLayerOptions : LayerOptions { public int? Contrast { get; set; }

  public int? FadeDuration { get; set; }

  public int? HueRotation { get; set; }

  public int? MaxBrightness { get; set; }

  public int? MinBrightness { get; set; }

  public int? Opacity { get; set; }

  public int? Saturation { get; set; }

}

The specification for these parameters is available at: https://learn.microsoft.com/en-us/javascript/api/azure-maps-control/atlas.imagelayeroptions?view=azure-maps-typescript-latest

It looks as though Brightness and Saturation require floating point values as well.

Thank you for the excellent control!

arnaudleclerc commented 3 months ago

Thanks for the hint! The package now defines Contrast, MaxBrightness, MinBrightness, Opacity and Saturation as double.

I just published a version 1.16.1 containing the fix. Please give it a shot and feel free to reopen this issue if necessary.